I've converted a 2D int array into a Stream:
IntStream dataStream = Arrays.stream(data).flatMapToInt(x -> Arrays.stream(x));
Now, I want to sort the list into ascending order. I've tried this:
dataStream.sorted().collect(Collectors.toList());
but I get the compile time error
I'm confused about this, because on the examples I've seen, similar things are done without errors.