Buggy code:
public class ListOrderedMap < K , V > extends AbstractMapDecorator < K , V > implements Serializable , OrderedMap < K , V > { private static final long serialVersionUID = 2728177751851003750L ; protected final List < K > insertOrder = new ArrayList < K > ( ) ; <START_BUG> public static < K , V > OrderedMap < K , V > listOrderedMap ( Map < K , V > map ) { <END_BUG> return new ListOrderedMap < K , V > ( map ) ; } public ListOrderedMap ( ) { } protected ListOrderedMap ( Map < K , V > map ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } @ SuppressWarnings ( "unchecked" ) private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } @ Override public OrderedMapIterator < K , V > mapIterator ( ) { } public K firstKey ( ) { } public K lastKey ( ) { } public K nextKey ( Object key ) { } public K previousKey ( Object key ) { } @ Override public V put ( K key , V value ) { } @ Override public void putAll ( Map < ? extends K , ? extends V > map ) { } public void putAll ( int index , Map < ? extends K , ? extends V > map ) { } @ Override public V remove ( Object key ) { } @ Override public void clear ( ) { } @ Override public Set < K > keySet ( ) { } public List < K > keyList ( ) { } @ Override public Collection < V > values ( ) { } public List < V > valueList ( ) { } @ Override public Set < Map . Entry < K , V > > entrySet ( ) { } @ Override public String toString ( ) { } public K get ( int index ) { } public V getValue ( int index ) { } public int indexOf ( Object key ) { } public V setValue ( int index , V value ) { } public V put ( int index , K key , V value ) { } public V remove ( int index ) { } public List < K > asList ( ) { } static class ValuesView < V > extends AbstractList < V > { private final ListOrderedMap < Object , V > parent ; @ SuppressWarnings ( "unchecked" ) ValuesView ( ListOrderedMap < ? , V > parent ) { } @ Override public int size ( ) { } @ Override public boolean contains ( Object value ) { } @ Override public void clear ( ) { } @ Override public Iterator < V > iterator ( ) { } @ Override public V get ( int index ) { } @ Override public V set ( int index , V value ) { } @ Override public V remove ( int index ) { } } static class KeySetView < K > extends AbstractSet < K > { private final ListOrderedMap < K , Object > parent ; @ SuppressWarnings ( "unchecked" ) KeySetView ( ListOrderedMap < K , ? > parent ) { } @ Override public int size ( ) { } @ Override public boolean contains ( Object value ) { } @ Override public void clear ( ) { } @ Override public Iterator < K > iterator ( ) { } } static class EntrySetView < K , V > extends AbstractSet < Map . Entry < K , V > > { private final ListOrderedMap < K , V > parent ; private final List < K > insertOrder ; private Set < Map . Entry < K , V > > entrySet ; public EntrySetView ( ListOrderedMap < K , V > parent , List < K > insertOrder ) { } private Set < Map . Entry < K , V > > getEntrySet ( ) { } @ Override public int size ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public boolean contains ( Object obj ) { } @ Override public boolean containsAll ( Collection < ? > coll ) { } @ Override @ SuppressWarnings ( "unchecked" ) public boolean remove ( Object obj ) { } @ Override public void clear ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } @ Override public Iterator < Map . Entry < K , V > > iterator ( ) { } } static class ListOrderedIterator < K , V > extends AbstractUntypedIteratorDecorator < K , Map . Entry < K , V > > { private final ListOrderedMap < K , V > parent ; private K last = null ; ListOrderedIterator ( ListOrderedMap < K , V > parent , List < K > insertOrder ) { } public Map . Entry < K , V > next ( ) { } @ Override public void remove ( ) { } } static class ListOrderedMapEntry < K , V > extends AbstractMapEntry < K , V > { private final ListOrderedMap < K , V > parent ; ListOrderedMapEntry ( ListOrderedMap < K , V > parent , K key ) { } @ Override public V getValue ( ) { } @ Override public V setValue ( V value ) { } } static class ListOrderedMapIterator < K , V > implements OrderedMapIterator < K , V > , ResettableIterator < K > { private final ListOrderedMap < K , V > parent ; private ListIterator < K > iterator ; private K last = null ; private boolean readable = false ;

Fix:
public static < K , V > ListOrderedMap < K , V > listOrderedMap ( Map < K , V > map ) {