@@ -0,0 +1,1260 @@
+package cpw.mods.fml.common.functions;%0A%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport com.google.common.collect.Collections2;%0Aimport com.google.common.collect.Lists;%0A%0Apublic class CollectionWrapperFactory %7B%0A    /**%0A     * Return a read only cast view of the supplied ungeneric collection, based on the element type given%0A     * @param coll The collection to cast%0A     * @param elementType the supertype contained in the collection%0A     * @return a collection asserting that type relationship%0A     */%0A    public static %3CT%3E Collection%3CT%3E wrap(@SuppressWarnings(%22rawtypes%22) Collection coll, Class%3CT%3E elementType)%0A    %7B%0A        Collection%3C?%3E asGeneric = coll;%0A        return Collections2.transform(asGeneric, new TypeCastFunction%3CT%3E(elementType));%0A    %7D%0A%0A    /**%0A     * Return a read only cast view of the supplied ungeneric list, based on the element type given%0A     * @param list The list to cast%0A     * @param elementType the supertype contained in the list%0A     * @return a list asserting that type relationship%0A     */%0A    public static %3CT%3E List%3CT%3E wrap(@SuppressWarnings(%22rawtypes%22) List list, Class%3CT%3E elementType)%0A    %7B%0A        List%3C?%3E asGeneric = list;%0A        return Lists.transform(asGeneric, new TypeCastFunction%3CT%3E(elementType));%0A    %7D%0A%7D%0A

Add a helper for casting some common collection types into generic form