1. Stream.distinct() is redundant before toSet() collector. Duplicates will be collapsed by Collector. 2. Stream.sorted() is redundant before toMap() collector. Keys will be shuffled by Collector (it's a HashMap in current implementation)
------------- Commit messages: - [PATCH] Remove redundant Stream.distinct()/sorted() steps Changes: https://git.openjdk.java.net/jdk/pull/5714/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5714&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8277535 Stats: 4 lines in 3 files changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/5714.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5714/head:pull/5714 PR: https://git.openjdk.java.net/jdk/pull/5714