Skip to content

Request: TreeMap firstKey() and lastKey(), Set firstElement() / lastElement() #176

@dobesv

Description

@dobesv

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions