Here you can find the source of hasNexts(List
private static <T> boolean hasNexts(List<Iterator<T>> heads)
//package com.java2s; // This program is dual-licensed under the EUPL v1.2 and AGPLv3 licenses. import java.util.Iterator; import java.util.List; public class Main { private static <T> boolean hasNexts(List<Iterator<T>> heads) { return heads.stream().anyMatch(Iterator::hasNext); }/*from w w w. j av a 2s . co m*/ }