It seems an omission that TreeMap has no simple and efficient way to fetch the lowest or highest key, and Set has no simple and efficient method to fetch the first or last element. Currently you would convert the entire set into a List and then use list methods to find the first/last element. Even if you convert the collection into a Stream it basically eagerly constructs a list due to an issue I filed elsewhere.
It seems an omission that
TreeMaphas no simple and efficient way to fetch the lowest or highest key, andSethas no simple and efficient method to fetch the first or last element. Currently you would convert the entire set into a List and then use list methods to find the first/last element. Even if you convert the collection into aStreamit basically eagerly constructs a list due to an issue I filed elsewhere.