I've been trying to play around with stream operations, and am trying to understand why the following doesn't convert each integer to a string. My understanding of peek() is that it acts as an intermediate operator, and applies the given operation to the stream if it is followed by a terminal operator. Any help would be great!
List<Integer> testList = Arrays.asList(10, 11, 12, 13, 14, 15);
testList.stream().peek(x -> x.toString()).forEach(x -> System.out.println(x.getClass()));