KeySet implements Set<String> { @Override public boolean contains(Object o) { return request.getValue(key(o)) != null; } KeySet(HasKeys<?> request); @Override boolean add(String e); @Override boolean addAll(Collection<? extends String> c); @Override void clear(); @Override boolean contains(Object o); @SuppressWarnings("unchecked") @Override boolean containsAll(Collection<?> c); @Override boolean isEmpty(); @Override Iterator<String> iterator(); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override int size(); @Override Object[] toArray(); @Override T[] toArray(T[] a);  }
@Test public void testContains() { expect(extractor.getValue("one")).andReturn(1); replay(extractor); assertTrue(entrySet.contains("one")); verify(extractor); }
@Test public void testContainsFalse() { expect(extractor.getValue("one")).andReturn(null); replay(extractor); assertFalse(entrySet.contains("one")); verify(extractor); }