Here you can find the source of merge(List> list)
public static <T> List<T> merge(List<List<T>> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> List<T> merge(List<List<T>> list) { List<T> result = new ArrayList<>(); list.stream().forEach(result::addAll); return result; }//ww w . ja v a 2s .c o m }