Java examples for java.util:List Convert
Convert List of Object to Set of Object
//package com.java2s; import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { public static void main(String[] argv) { List tList = java.util.Arrays.asList("asdf", "java2s.com"); System.out.println(setList2Set(tList)); }/* ww w . j a va2s. c om*/ public static Set setList2Set(List<?> tList) { Set<?> tSet = new HashSet(tList); return tSet; } }