Collects stream to immutable set that keeps elements in the same order as the original stream
()
| 55 | * Collects stream to immutable set that keeps elements in the same order as the original stream |
| 56 | */ |
| 57 | public static <T> Collector<T, ?, Set<T>> toSequencedSet() { |
| 58 | return collectingAndThen(toCollection(LinkedHashSet::new), Collections::unmodifiableSet); |
| 59 | } |
| 60 | |
| 61 | /** Create an immutable set sorted in natural order */ |
| 62 | public static <T extends Comparable<? super T>> Set<T> sortedSet(Set<T> source) { |
no outgoing calls