Here you can find the source of min(List
public static Long min(List<Long> list)
//package com.java2s; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.LongAccumulator; public class Main { public static Long min(List<Long> list) { Objects.requireNonNull(list, "list is null"); if (list.isEmpty()) { throw new IllegalArgumentException("list is empty"); }//from w w w .j a va 2s . c o m LongAccumulator la = new LongAccumulator((left, right) -> { return left > right ? right : left; }, Long.MAX_VALUE); list.parallelStream().forEach(e -> la.accumulate(e)); return la.longValue(); } }