这样做就可以了:
private final Iterator<? extends Map.Entry<K, ? extends Collection<V>>> iterator;
您仍然可以像这样使用迭代器:
public void foo(){ while(iterator.hasNext()){ Entry<K, ? extends Collection<V>> entry = iterator.next(); Collection<V> value = entry.getValue(); }}作为参考,请阅读get and
put原理(最初来自Java
Generics和Collections)



