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

    Enumeration<Object> enumeration = createMock(Enumeration.class);
    expect(enumeration.hasMoreElements()).andReturn(true);
    expect(enumeration.nextElement()).andReturn(1);
    expect(enumeration.hasMoreElements()).andReturn(true);
    expect(enumeration.nextElement()).andReturn(1);
    expect(enumeration.hasMoreElements()).andReturn(false);
    replay(enumeration);
    assertEquals(2, CollectionUtil.enumerationSize(enumeration));
    verify(enumeration);
}