@Override protected SortedMap<String, String> create(Entry<String, String>[] entries) { SortedMap<String, String> map = populate(new TreeMap<String, String>(), entries); return Collections.checkedSortedMap(map, String.class, String.class); } })
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass()); classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass()); classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass()); classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());
PojoWithObjectMapFields fill() { TreeMap<String, String> tm = new TreeMap<String, String>(); tm.put("foo", "bar"); EnumMap<GuitarPickup, Size> em = new EnumMap<GuitarPickup, Size>( GuitarPickup.class); em.put(GuitarPickup.CONTACT, Size.SMALL); emptyMap = Collections.emptyMap(); singletonMap = Collections.singletonMap("key", "value"); unmodifiableMap = Collections.unmodifiableMap(Collections .emptyMap()); unmodifiableSortedMap = Collections.unmodifiableSortedMap(tm); synchronizedMap = Collections.synchronizedMap(em); synchronizedSortedMap = Collections.synchronizedSortedMap(tm); checkedMap = Collections.checkedMap(em, GuitarPickup.class, Size.class); checkedSortedMap = Collections.checkedSortedMap(tm, String.class, String.class); return this; }
public SortedMap<K,V> subMap(K fromKey, K toKey) { return checkedSortedMap(sm.subMap(fromKey, toKey), keyType, valueType); } public SortedMap<K,V> headMap(K toKey) {
@Override protected SortedMap<String, String> create(Entry<String, String>[] entries) { SortedMap<String, String> map = populate(new TreeMap<String, String>(), entries); return Collections.checkedSortedMap(map, String.class, String.class); } })
public SortedMap<K,V> subMap(K fromKey, K toKey) { return checkedSortedMap(sm.subMap(fromKey, toKey), keyType, valueType); } public SortedMap<K,V> headMap(K toKey) {
public SortedMap<K,V> headMap(K toKey) { return checkedSortedMap(sm.headMap(toKey), keyType, valueType); } public SortedMap<K,V> tailMap(K fromKey) {
public SortedMap<K,V> tailMap(K fromKey) { return checkedSortedMap(sm.tailMap(fromKey), keyType, valueType); } }
public SortedMap<K,V> tailMap(K fromKey) { return checkedSortedMap(sm.tailMap(fromKey), keyType, valueType); } }
public SortedMap<K,V> headMap(K toKey) { return checkedSortedMap(sm.headMap(toKey), keyType, valueType); } public SortedMap<K,V> tailMap(K fromKey) {
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass()); classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass()); classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass()); classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());