Here you can find the source of zip(List> lists)
public static <T> List<List<T>> zip(List<List<T>> lists)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<List<T>> zip(List<List<T>> lists) { List<List<T>> zipped = new ArrayList<List<T>>(); for (List<T> list : lists) { for (int i = 0, listSize = list.size(); i < listSize; i++) { List<T> zipList; if (i >= zipped.size()) { zipped.add(zipList = new ArrayList<T>()); } else { zipList = zipped.get(i); }//w w w. j a v a 2s. c om zipList.add(list.get(i)); } } return zipped; } }