Here you can find the source of toList(Set
public static <T> ArrayList<T> toList(Set<T> theValues)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Set; public class Main { public static <T> ArrayList<T> toList(Set<T> theValues) { ArrayList<T> retVal = new ArrayList<T>(); if (theValues != null) { for (T t : theValues) { retVal.add(t);/*from ww w . ja v a 2 s . co m*/ } } return retVal; } }