public Set<Entry<K, V>> entrySet() { return new AbstractSet<Entry<K, V>>() { public Iterator<Entry<K, V>> iterator() { return new Iterator<Entry<K, V>>() { private int pt = -1; public void remove() { throw new UnsupportedOperationException(); } @SuppressWarnings("unchecked") public Entry<K, V> next() { return new AbstractMapEntry( list.get(++pt), null) {}; } public boolean hasNext() { return pt < list.size(); } }; } public int size() { return list.size(); } public boolean contains(Object o) { if (o instanceof Entry) { if (list.contains(((Entry) o).getKey())) { return true; } } return false; } }; }