class ExtendedSet implements Set<E> {

    public boolean conditionalRemove(E entry, Predicate<E> entryTest) {
        AtomicBoolean updated = new AtomicBoolean(false);
        map.compute(entry, (k, v) -> {
            if (entryTest.test(v)) {
                updated.set(true);
                return null;
            }
            return v;
        });
        return updated.get();
    }

    public  ExtendedSet(Map<E, E> map);

}