class RemovableKeySet extends KeySet {

    @SuppressWarnings("unchecked")
    @Override
    public boolean retainAll(Collection<?> c) {
        Collection<String> realCollection = (Collection<String>) c;
        boolean retValue = false;
        Set<String> keysToRemove = new LinkedHashSet<String>();
        for (Enumeration<String> keys = request.getKeys(); keys.hasMoreElements();) {
            String key = keys.nextElement();
            if (!realCollection.contains(key)) {
                retValue = true;
                keysToRemove.add(key);
            }
        }
        for (String key : keysToRemove) {
            request.removeValue(key);
        }
        return retValue;
    }

    public  RemovableKeySet(HasRemovableKeys<?> request);

}