Java examples for java.util:List Convert
Convert set to list
//package com.java2s; import java.util.ArrayList; import java.util.List; import java.util.Set; public class Main { public static <T> List<T> set_to_list(Set<T> set) { if (set == null) return null; List<T> list = new ArrayList<T>(); for (T obj : set) { list.add(obj);//from w w w. j av a2 s.co m } return list; } }