Here you can find the source of mergeToList(Object src, Object... args)
public static List mergeToList(Object src, Object... args)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List mergeToList(Object src, Object... args) { List valList = new ArrayList(); add(valList, src);/*w w w .j av a 2 s .co m*/ for (Object arg : args) { add(valList, arg); } return valList; } public static List add(List valList, Object src) { if (src == null) { return valList; } if (src instanceof List) { valList.addAll((List) src); } else { valList.add(src); } return valList; } }