Code example for WeakHashMap

public final class AttributeCache { 
    private static AttributeCache sInstance = null;
    private final Context mContext;
    private final WeakHashMap<String, Package> mPackages =
            new WeakHashMap<String, Package>();
    private final Configuration mConfiguration = new Configuration();
    public final static class Package { 
        public final Context context;
        private final SparseArray<HashMap<int[], Entry>> mMap
                = new SparseArray<HashMap<int[], Entry>>();
        public Package(Context c) {
            context = c;
    public final static class Entry { 
        public final Context context;
Connect your IDE to all the code out there  Get Codota for Java