Skip to content

Conversation

faisalmastoi55
Copy link

Adds tests for 'Map.entrySet().stream()' and its associated 'Spliterator' characteristics as requested in issue #7855.

Validates that:

  • 'map.entrySet().stream().toList()' returns exactly the same entries as the original map.
  • For maps that allow null values (e.g., HashMap), the 'Spliterator.NONNULL' characteristic is not present if nulls exist.
  • For maps that disallow nulls (e.g., ImmutableMap), the 'Spliterator.NONNULL' characteristic is present.

Test coverage includes:

  • Basic map entries streaming validation.
  • Validation for Spliterator characteristics with and without nulls.

These tests help ensure compliance with Java 8+ stream semantics and provide regression protection for future implementations.

Fixes #7855.

Copy link

google-cla bot commented Jul 10, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kluever kluever added type=enhancement Make an existing feature better package=testing P3 no SLO labels Jul 14, 2025
@faisalmastoi55 faisalmastoi55 force-pushed the test/map-entryset-stream-spliterator branch from bc60bad to a1c9d04 Compare July 22, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 no SLO package=testing type=enhancement Make an existing feature better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

testlib: add tests for ConcurrentMap to make sure its derived Sets are concurrent
2 participants