Java examples for java.util:List Filter
remove Duplication in a List
//package com.java2s; import java.util.ArrayList; import java.util.HashSet; import java.util.List; public class Main { public static void main(String[] argv) { List list = java.util.Arrays.asList("asdf", "java2s.com"); System.out.println(removeDuplication(list)); }/*from w ww . ja va 2 s . c o m*/ public static <T> List<T> removeDuplication(List<T> list) { return new ArrayList<T>(new HashSet<T>(list)); } }