@SafeVarargs
    public static <T> Set<T> unmodifiableSet(T... elements) {
        return Collections.unmodifiableSet(newHashSet(elements));
    }
@ SafeVarargs public static < T > Set < T > unmodifiableSet ( T ... elements ) { return Collections . unmodifiableSet ( newHashSet ( elements ) ) ; }
Creates a new unmodifiable {@code HashSet} containing all elements from {@code elements}.

@param elements the elements that the set should contain, must not be {@literal null}.
@param <T> the element type
@return a new {@code HashSet} containing all elements from {@code elements}.