package openmods.utils;

import java.util.Map;

import com.google.common.collect.Maps;

public abstract class CachedFactory<K, V> {

	private final Map<K, V> cache = Maps.newHashMap();

	public V getOrCreate(K key) {
		V value = cache.get(key);

		if (value == null) {
			value = create(key);
			cache.put(key, value);
		}

		return value;
	}

	protected abstract V create(K key);
}

@@ -337,16 +337,74 @@
 ue;%0A%09%7D%0A%0A
+%09public V remove(K key) %7B%0A%09%09return cache.remove(key);%0A%09%7D%0A%0A
 %09protect

Add remove method to cached factory