@Test public void stringList_shouldGetDistinct() { final Map<String, List<String>> data = Map.of("index", List.of("a", "b", "a", "c")); assertThat(ListQueryParameterUtils.getParameterAsStringList(data, "index")) .isEqualTo(List.of("a", "b", "c")); }
public static List<String> getParameterAsStringList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { final String list = String.join(",", validateQueryParameter(parameterMap, key)); return splitter.splitToStream(list).distinct().map(String::trim).collect(Collectors.toList()); }
ListQueryParameterUtils { public static List<String> getParameterAsStringList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { final String list = String.join(",", validateQueryParameter(parameterMap, key)); return splitter.splitToStream(list).distinct().map(String::trim).collect(Collectors.toList()); } }
ListQueryParameterUtils { public static List<String> getParameterAsStringList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { final String list = String.join(",", validateQueryParameter(parameterMap, key)); return splitter.splitToStream(list).distinct().map(String::trim).collect(Collectors.toList()); }  }
ListQueryParameterUtils { public static List<String> getParameterAsStringList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { final String list = String.join(",", validateQueryParameter(parameterMap, key)); return splitter.splitToStream(list).distinct().map(String::trim).collect(Collectors.toList()); }  static List<Integer> getParameterAsIntegerList(
      final Map<String, List<String>> parameterMap, final String key); static List<String> getParameterAsStringList(
      final Map<String, List<String>> parameterMap, final String key); }
ListQueryParameterUtils { public static List<String> getParameterAsStringList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { final String list = String.join(",", validateQueryParameter(parameterMap, key)); return splitter.splitToStream(list).distinct().map(String::trim).collect(Collectors.toList()); }  static List<Integer> getParameterAsIntegerList(
      final Map<String, List<String>> parameterMap, final String key); static List<String> getParameterAsStringList(
      final Map<String, List<String>> parameterMap, final String key); static final String MISSING_QUERY_PARAMETER; static final Splitter splitter; }