Here you can find the source of arrayWrap(final Stream> stream)
public static Object[][] arrayWrap(final Stream<?> stream)
//package com.java2s; //License from project: Open Source License import static java.util.stream.Collectors.toList; import java.util.stream.Stream; public class Main { /**// w w w .ja v a 2 s .c om * Produces array of stream's elements wrapped into arrays. */ public static Object[][] arrayWrap(final Stream<?> stream) { return stream.map(s -> new Object[] { s }).collect(toList()).toArray(new Object[0][]); } }