@Test(expected = IllegalArgumentException.class) public void mapParametersFromParameterWithTwoParameterIdentifier() { Set<String> parameters = Collections.singleton(id + AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER + "mockValue" + AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER + "mockValue2"); ReporterParameterParser.mapParameters(parameters); fail("Did not throw expected exception"); }
static Map<String, String> mapParameters(Set<String> parameters) { return parameters.stream() .map(p -> p.split(AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER)) .filter(sa -> { if (sa.length != 2) { throw new IllegalArgumentException(Arrays.toString(sa) + " does not have the proper format."); } else { return true; } }) .collect(Collectors.toMap(sa -> sa[0], sa -> sa[1])); }
ReporterParameterParser { static Map<String, String> mapParameters(Set<String> parameters) { return parameters.stream() .map(p -> p.split(AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER)) .filter(sa -> { if (sa.length != 2) { throw new IllegalArgumentException(Arrays.toString(sa) + " does not have the proper format."); } else { return true; } }) .collect(Collectors.toMap(sa -> sa[0], sa -> sa[1])); } }
ReporterParameterParser { static Map<String, String> mapParameters(Set<String> parameters) { return parameters.stream() .map(p -> p.split(AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER)) .filter(sa -> { if (sa.length != 2) { throw new IllegalArgumentException(Arrays.toString(sa) + " does not have the proper format."); } else { return true; } }) .collect(Collectors.toMap(sa -> sa[0], sa -> sa[1])); } private  ReporterParameterParser(); }
ReporterParameterParser { static Map<String, String> mapParameters(Set<String> parameters) { return parameters.stream() .map(p -> p.split(AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER)) .filter(sa -> { if (sa.length != 2) { throw new IllegalArgumentException(Arrays.toString(sa) + " does not have the proper format."); } else { return true; } }) .collect(Collectors.toMap(sa -> sa[0], sa -> sa[1])); } private  ReporterParameterParser();  }
ReporterParameterParser { static Map<String, String> mapParameters(Set<String> parameters) { return parameters.stream() .map(p -> p.split(AbstractAntennaCLIOptions.PARAMETER_IDENTIFIER)) .filter(sa -> { if (sa.length != 2) { throw new IllegalArgumentException(Arrays.toString(sa) + " does not have the proper format."); } else { return true; } }) .collect(Collectors.toMap(sa -> sa[0], sa -> sa[1])); } private  ReporterParameterParser();   }