Generally, if you need an index, you’ll have to stream over the indices. Then, the task becomes straight-forward:
List<Integer> intArr = Arrays.asList(5, 8, 3, 2);
IntStream.range(0, intArr.size())
.reduce((a,b)->intArr.get(a)<intArr.get(b)? b: a)
.ifPresent(ix->System.out.println("Index "+ix+", value "+intArr.get(ix)));
a more elegant solution, which unfortunately incorporates boxing overhead is
IntStream.range(0, intArr.size())
.boxed().max(Comparator.comparing(intArr::get))
.ifPresent(ix->System.out.println("Index "+ix+", value "+intArr.get(ix)));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…