Java tutorial
//package com.java2s; /* * Copyright (C) 2013 * * 52North Initiative for Geospatial Open Source Software GmbH * Contact: Andreas Wytzisk * Martin-Luther-King-Weg 24 * 48155 Muenster, Germany * info@52north.org * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import java.util.Collections; import java.util.Set; public class Main { /** * @return an <b>UNMODIFIABLE</b> Set<T> */ public static <T> Set<T> unmodifiableSet(final Set<? extends T> s) { return (s == null) ? Collections.<T>emptySet() : Collections.unmodifiableSet(s); } }