HeaderValuesMap implements Map<String, String[]> { public boolean isEmpty() { return !request.getKeys().hasMoreElements(); } HeaderValuesMap(EnumeratedValuesExtractor request); void clear(); boolean containsKey(Object key); boolean containsValue(Object value); Set<Map.Entry<String, String[]>> entrySet(); @Override boolean equals(Object o); String[] get(Object key); @Override int hashCode(); boolean isEmpty(); Set<String> keySet(); String[] put(String key, String[] value); void putAll(Map<? extends String, ? extends String[]> map); String[] remove(Object key); int size(); Collection<String[]> values();  }
@SuppressWarnings("unchecked") @Test public void testIsEmpty() { Enumeration<String> keys = createMock(Enumeration.class); expect(extractor.getKeys()).andReturn(keys); expect(keys.hasMoreElements()).andReturn(true); replay(extractor, keys); assertFalse(map.isEmpty()); verify(extractor, keys); }
@SuppressWarnings("unchecked") @Test public void testIsEmptyTrue() { Enumeration<String> keys = createMock(Enumeration.class); expect(extractor.getKeys()).andReturn(keys); expect(keys.hasMoreElements()).andReturn(false); replay(extractor, keys); assertTrue(map.isEmpty()); verify(extractor, keys); }