Here you can find the source of asList(T firstItem, T... otherItems)
@SafeVarargs public static <T> List<T> asList(T firstItem, T... otherItems)
//package com.java2s; /*//ww w . jav a2s . co m * Hibernate Search, full-text search for your domain model * * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { @SafeVarargs public static <T> List<T> asList(T firstItem, T... otherItems) { List<T> list = new ArrayList<>(otherItems.length + 1); list.add(firstItem); Collections.addAll(list, otherItems); return list; } }