Returns an OptionalInt describing the minimum element of this stream, or an empty optional if this stream is empty. This is a special case of a reduction.
Examples
package com.logicbig.example.intstream;
import java.util.stream.IntStream;
public class MinExample {
public static void main(String... args) { IntStream intStream = IntStream.range(1, 5); int i = intStream.min() .orElseThrow(IllegalArgumentException::new); System.out.println(i); } }