Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Collections; public class Main { public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> collection) { if (collection == null) { return Collections.emptyList(); } else { return Collections.unmodifiableCollection(collection); } } }