TextMapExtractAdapter implements TextMapExtract { @Override public Iterator<Map.Entry<String, String>> iterator() { return map.entrySet().iterator(); } TextMapExtractAdapter(final Map<String,String> map); @Override Iterator<Map.Entry<String, String>> iterator();  }
@Test public void testIterator() { Map<String, String> headers = new LinkedHashMap<String, String>(); headers.put("foo", "bar"); TextMapExtractAdapter extractAdapter = new TextMapExtractAdapter(headers); Iterator<Entry<String, String>> iterator = extractAdapter.iterator(); assertTrue(iterator.hasNext()); assertEquals("bar", iterator.next().getValue()); assertFalse(iterator.hasNext()); }