Create an immutable set sorted in natural order
(Set<T> source)
| 60 | |
| 61 | /** Create an immutable set sorted in natural order */ |
| 62 | public static <T extends Comparable<? super T>> Set<T> sortedSet(Set<T> source) { |
| 63 | return unmodifiableSet(new TreeSet<>(source)); |
| 64 | } |
| 65 | |
| 66 | /** Check if two sets have at least one common element */ |
| 67 | public static <T> boolean haveCommonElements(Set<T> set1, Set<T> set2) { |
no outgoing calls