Java8 unordered () disordering is invalid, and the result of multiple runs is still consistent with the order of the elements in the stream
/ / results of multiple runs: 5, 1, 2, 6, 3, 7, 4 did not achieve the effect of disorder
Stream.of (5, 1, 2, 6, 3, 7, 4). Unordered (). ForEach (System.out::println);
ask for advice
related codes
/**
* S unordered(); , ,
*/
@Test
public void unorderedTest() {
Stream.of(5, 1, 2, 6, 3, 7, 4).forEach(System.out::println);
// : 5, 1, 2, 6, 3, 7, 4 TODO
Stream.of(5, 1, 2, 6, 3, 7, 4).unordered().forEach(System.out::println);
}