// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.List;
import java.util.stream.IntStream;

public class IntStreamMax {
    public static void main(String[] args) {
        List<Integer> prices1 = List.of(12, 45, 67);
        int declarativeMax1 = prices1.stream().reduce(0, Math::max);
        System.out.println(declarativeMax1);
        int declarativeMax1x = prices1.stream().mapToInt(v -> v).max().getAsInt();
        System.out.println(declarativeMax1x);
        IntStream prices2 = IntStream.of(12, 45, 67);
        int declarativeMax2 = prices2.max().getAsInt();
        System.out.println(declarativeMax2);
    }
}
