Say you have a list of objects and want to sort by a boolean property but within the resulting false and true sections keep the original order: 1T 2T 3F 4T 5F ~> 3F 5F 1T 2T 4T How to do that? Easy!
2
0
8
0
2
A sort that maintains order of values that are equal (according the comparison) is called *stable* and `Collections.sort` is stable (docs.oracle.com/en/java/javase…). So a simple `sort` does the trick: Collections.sort( myList, Comparator.comparing( MyType::booleanProp)) 👍