I am using max()
to find the maximum value in the list but the code below returns 4
though the max value is 90
.
List<Integer> list = new ArrayList<>(Arrays.asList(4,12,19,10,90,30,60,17,90));
System.out.println(list.stream().max(Integer::max).get());