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();
    }
@Test
    public void testConditionalRemove() {
        ExtendedSet<TestValue> set = new ExtendedSet<>(Maps.newConcurrentMap());
        TestValue small = new TestValue("foo", 1);
        TestValue medium = new TestValue("foo", 2);

        assertTrue(set.add(small));
        set.conditionalRemove(medium, existing -> existing.value2() < medium.value2);
        assertFalse(set.contains(small));

        assertTrue(set.add(small));
        set.conditionalRemove(medium, existing -> existing.value2() > medium.value2);
        assertTrue(set.contains(small));

    }