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

    Enumeration<String> keys = createMock(Enumeration.class);
    Enumeration<String> values1 = createMock(Enumeration.class);
    Enumeration<String> values2 = createMock(Enumeration.class);
    EnumeratedValuesExtractor otherExtractor = createMock(EnumeratedValuesExtractor.class);
    Enumeration<String> otherValues1 = createMock(Enumeration.class);
    Enumeration<String> otherValues2 = createMock(Enumeration.class);
    expect(extractor.getKeys()).andReturn(keys);
    expect(keys.hasMoreElements()).andReturn(true);
    expect(keys.nextElement()).andReturn("one");
    expect(keys.hasMoreElements()).andReturn(true);
    expect(keys.nextElement()).andReturn("two");
    expect(keys.hasMoreElements()).andReturn(false);
    expect(extractor.getValues("one")).andReturn(values1);
    expect(values1.hasMoreElements()).andReturn(true);
    expect(values1.nextElement()).andReturn("value1");
    expect(values1.hasMoreElements()).andReturn(false);
    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);
    expect(otherExtractor.getValues("one")).andReturn(otherValues1);
    expect(otherValues1.hasMoreElements()).andReturn(true);
    expect(otherValues1.nextElement()).andReturn("value1");
    expect(otherValues1.hasMoreElements()).andReturn(false);
    expect(otherExtractor.getValues("two")).andReturn(otherValues2);
    expect(otherValues2.hasMoreElements()).andReturn(true);
    expect(otherValues2.nextElement()).andReturn("value2");
    expect(otherValues2.hasMoreElements()).andReturn(true);
    expect(otherValues2.nextElement()).andReturn("value3");
    expect(otherValues2.hasMoreElements()).andReturn(false);
    replay(extractor, otherExtractor, keys, values1, values2, otherValues1, otherValues2);
    HeaderValuesMap otherMap = new HeaderValuesMap(otherExtractor);
    assertTrue(map.equals(otherMap));
    verify(extractor, otherExtractor, keys, values1, values2, otherValues1, otherValues2);
}