@SuppressWarnings("unchecked")
@Test
public void testHashCode() {

    Enumeration<String> keys = createMock(Enumeration.class);
    expect(extractor.getKeys()).andReturn(keys);
    expect(keys.hasMoreElements()).andReturn(true);
    expect(keys.nextElement()).andReturn("first");
    expect(keys.hasMoreElements()).andReturn(true);
    expect(keys.nextElement()).andReturn("second");
    expect(keys.hasMoreElements()).andReturn(false);
    Integer value1 = 1;
    expect(extractor.getValue("first")).andReturn(value1);
    expect(extractor.getValue("second")).andReturn(null);
    replay(extractor, keys);
    assertEquals(("first".hashCode() ^ value1.hashCode())
            + ("second".hashCode() ^ 0), map.hashCode());
    verify(extractor, keys);
}