### Question:
MapBackedSet extends AbstractSet<E> implements Serializable { @Override public boolean remove(Object o) { return map.remove(o) != null; } MapBackedSet(Map<E, Boolean> map); @Override int size(); @Override boolean contains(Object o); @Override boolean add(E o); @Override boolean remove(Object o); @Override void clear(); @Override Iterator<E> iterator();  }### Answer:
@Test @SuppressWarnings({ "unchecked", "rawtypes" }) public void testRemove() { Map map = createStrictMock(Map.class); expect(map.remove("key")).andReturn(true); expect(map.remove("key")).andReturn(null); replay(map); assertTrue(new MapBackedSet(map).remove("key")); assertFalse(new MapBackedSet(map).remove("key")); verify(map); }