@Override
        public boolean retainAll(Collection<?> collection) {
            int n = colGetSize();
            boolean changed = false;
            for (int i = 0; i < n; i++) {
                Object cur = colGetEntry(i, 1);
                if (!collection.contains(cur)) {
                    colRemoveAt(i);
                    i--;
                    n--;
                    changed = true;
                }
            }
            return changed;
        }
Helper for writing standard Java collection interfaces to a data
structure like {@link ArrayMap}.

@author RePlugin Team
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/basic/MapCollections.java