This is used to optimize some stream operations, such as distinct(),
which only needs constant memory when operating on a sorted list.
Any stream operations that potentially change the sorting order should
override this method to properly reflect the actual sorting order.