I believe LazyMap.decorate(Map<K, V> map, Factory<V> factory) should have following signature LazyMap.decorate(Map<K, V> map, Factory<? extends V> factory), so following snippet will work:
public class Sandbox {
public static void main(String[] args) {
Map<A, Collection<B>> map = LazyMap.decorate(new HashMap<A, Collection<B>>(), FactoryUtils.prototypeFactory(new ArrayList<B>()));
map.put(new A(), new ArrayList<B>());
}
}
class A { }
class B { }