Here you can find the source of asStream(T[] items)
public static <T> Stream<T> asStream(T[] items)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Stream; public class Main { public static <T> Stream<T> asStream(T[] items) { return nullGuard(items).stream(); }//w ww .j a v a 2s . co m private static <T> List<T> nullGuard(T[] items) { if (items == null) { return Collections.emptyList(); } else { return Arrays.asList(items); } } }