package com.ihg.dec.framework.commons.utils.cow; import java.util.AbstractSet; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.Map.Entry; public class AspectJBugTestCase { class Value { private V value; public Value(V value) { this.value = value; } public V getValue() { return value; } public void setValue(V value) { this.value = value; } } class EntrySetEntry implements Entry { private Entry> wrapped; public EntrySetEntry(Entry> wrapped) { this.wrapped = wrapped; } public K getKey() { return wrapped.getKey(); } public V getValue() { return wrapped.getValue().getValue(); } public V setValue(V value) { Value old = wrapped.setValue(new Value(value)); return old == null ? null : old.getValue(); } } class EntrySetIterator implements Iterator> { private Iterator>> wrapped; public EntrySetIterator(Iterator>> wrapped) { this.wrapped = wrapped; } public boolean hasNext() { return wrapped.hasNext(); } public Entry next() { return new EntrySetEntry(wrapped.next()); } public void remove() { throw new UnsupportedOperationException("Not implemented."); } } class EntrySet extends AbstractSet> implements Set> { private Set>> wrapped; public EntrySet(Set>> wrapped) { this.wrapped = wrapped; } @Override public Iterator> iterator() { return new EntrySetIterator(wrapped.iterator()); } @Override public int size() { return wrapped.size(); } } public void testIt() { new EntrySet( new HashSet>>()); } } aspect X { declare parents: *.Entry* implements java.io.Serializable; }