Create an immutable Set that keeps the order of elements
(T... values)
| 32 | public class Sets { |
| 33 | /** Create an immutable Set that keeps the order of elements */ |
| 34 | @SafeVarargs |
| 35 | public static <T> Set<T> sequencedSetOf(T... values) { |
| 36 | Set<T> set = new LinkedHashSet<>(); |
| 37 | addAll(set, values); |
| 38 | return unmodifiableSet(set); |
| 39 | } |
| 40 | |
| 41 | /** Create an immutable set that sorts its elements in natural order */ |
| 42 | @SafeVarargs |