Here you can find the source of toList(@SuppressWarnings("unchecked") T... ts)
public static <T> List<T> toList(@SuppressWarnings("unchecked") T... ts)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static <T> List<T> toList(@SuppressWarnings("unchecked") T... ts) { return Arrays.asList(ts); }/*from w ww . jav a 2s . co m*/ public static <T> List<T> toList(List<T> list, @SuppressWarnings("unchecked") T... ts) { List<T> result = new ArrayList<T>(list); result.addAll(Arrays.asList(ts)); return result; } public static <T> List<T> toList(List<T> list, List<T> list2, @SuppressWarnings("unchecked") T... ts) { List<T> result = new ArrayList<T>(list); result.addAll(list2); result.addAll(Arrays.asList(ts)); return result; } }