The following nine static methods of the class Collections convert the provided collection from a raw type (one without generics) to a certain type of element. The name checked implies that after the transformation, the type of each newly added element will be checked:
- Set<E> checkedSet(Set<E> s, Class<E> type)
- List<E> checkedList(List<E> list, Class<E> type)
- Queue<E> checkedQueue(Queue<E> queue, Class<E> type)
- Collection<E> checkedCollection(Collection<E> collection, Class<E> type)
- Map<K,V> checkedMap(Map<K,V> map, Class<K> keyType, Class<V> valueType)
- SortedSet<E> checkedSortedSet(SortedSet<E> set, Class<E> type)
- NavigableSet<E> checkedNavigableSet(NavigableSet<E> set, Class<E> type)
- SortedMap<K,V> checkedSortedMap(SortedMap<K,V> ...