class Collect {

    @SuppressWarnings("unchecked")
    public static <T, V> Set<T> unmodifiableSet(Function<V, T> extractor, V... values) {
        Set<T> newSet = new HashSet<>();
        for (V value : values) {
            if (value != null) {
                newSet.add(extractor.apply(value));
            }
        }
        return Collections.unmodifiableSet(newSet);
    }

    private  Collect();

}