Java tutorial
//package com.java2s; import java.util.Collections; import java.util.Set; public class Main { public static <K> Set<K> createUnmodifiableSet(Set<K> ks) { return Collections.unmodifiableSet(ks); } public static <T> Set<T> unmodifiableSet(Set<T> orig) { return Collections.unmodifiableSet(orig); } }