StringSetParam extends AbstractParam<Set<String>> { @Override protected Set<String> parse(@Nullable final String input) throws Exception { if (Strings.isNullOrEmpty(input)) { return Collections.emptySet(); } final Iterable<String> splitter = Splitter.on(',').omitEmptyStrings().trimResults().split(input); return ImmutableSet.copyOf(splitter); } StringSetParam(String input);   }
@Test public void testParse() throws Exception { final StringSetParam param = new StringSetParam("1,3, 2 ,asdf, 3"); final Set<String> expected = ImmutableSet.of("1", "2", "3"); assertThat(param.parse("1,2,asdf,3")).containsAll(expected); }