Skip to content

Modern collections: immutable factories, unmodifiable views and sequenced collections #95

Open

Description

@mperor

Goal: clarify which collection you actually get from the modern APIs.

Show:

  • List.of / List.copyOf (immutable, null-hostile) vs Collections.unmodifiableList (view that reflects changes)
  • Stream.toList() vs Collectors.toList() (mutability guarantees)
  • SequencedCollection: getFirst/getLast/reversed() across List, LinkedHashSet, LinkedHashMap

Where: FirstSteps/src/test/java/pl/mperor/lab/java/idiom

Activity

  1. added
    track:idiomsIdiomatic modern Java combining several features
    dailyQueued for the daily learning PR
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dailyQueued for the daily learning PRtrack:idiomsIdiomatic modern Java combining several features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions