Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { @SafeVarargs public static <T> List<T> unionArraysAsList(T[]... arrays) { return Stream.of(arrays).map(Arrays::asList).flatMap(Collection::stream).collect(Collectors.toList()); } }