@Test public void testConvert() throws Exception { DefaultConversionService conversionService = new DefaultConversionService(); conversionService.addConverter(new ArrayToCollection()); List<String> list = new ArrayList<>(); list.add("alien"); list.add("star"); list.add("year"); List result = conversionService.convert(list, List.class); Assert.assertEquals(3, result.size()); }
@Override public Set<String> convert(List<String> source) { return new HashSet<>(source); }
ArrayToCollection implements Converter<List<String>, Set<String>> { @Override public Set<String> convert(List<String> source) { return new HashSet<>(source); } }
ArrayToCollection implements Converter<List<String>, Set<String>> { @Override public Set<String> convert(List<String> source) { return new HashSet<>(source); }  }
ArrayToCollection implements Converter<List<String>, Set<String>> { @Override public Set<String> convert(List<String> source) { return new HashSet<>(source); }  @Override Set<String> convert(List<String> source); }
ArrayToCollection implements Converter<List<String>, Set<String>> { @Override public Set<String> convert(List<String> source) { return new HashSet<>(source); }  @Override Set<String> convert(List<String> source);  }