HeaderValuesMap implements Map<String, String[]> { public String[] get(Object key) { return getHeaderValues(key(key)); } 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 testGet() { Enumeration<String> values2 = createMock(Enumeration.class); expect(extractor.getValues("two")).andReturn(values2); expect(values2.hasMoreElements()).andReturn(true); expect(values2.nextElement()).andReturn("value2"); expect(values2.hasMoreElements()).andReturn(true); expect(values2.nextElement()).andReturn("value3"); expect(values2.hasMoreElements()).andReturn(false); replay(extractor, values2); assertArrayEquals(new String[] {"value2", "value3"}, map.get("two")); verify(extractor, values2); }