Here you can find the source of convertSetToList(Set
public static <T> List<T> convertSetToList(Set<T> set)
//package com.java2s; /*//w w w. ja v a 2s . c om * Copyright 2011-2016 ZXC.com All right reserved. This software is the confidential and proprietary information of * ZXC.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into with ZXC.com. */ import java.util.ArrayList; import java.util.List; import java.util.Set; public class Main { public static <T> List<T> convertSetToList(Set<T> set) { List<T> list = new ArrayList<T>(); if (set != null && set.size() > 0) { for (T t : set) { list.add(t); } } return list; } }