Java examples for java.util:Collection Creation
Create an unmodifiable Map
//package com.java2s; import java.util.Collections; import java.util.Map; public class Main { /**//from w ww. ja va 2 s . com * @return an <b>UNMODIFIABLE</b> Map<K, V> */ public static <K, V> Map<K, V> unmodifiableMap( final Map<? extends K, ? extends V> m) { return (m == null) ? Collections.<K, V> emptyMap() : Collections .unmodifiableMap(m); } }