@Test
public void testCloseAll() {

    IMocksControl c = EasyMock.createControl();
    EndpointDescription endpoint = c.createMock(EndpointDescription.class);
    CloseHandler closeHandler = c.createMock(CloseHandler.class);
    c.replay();
    ImportRegistrationImpl i1 = new ImportRegistrationImpl(endpoint, closeHandler, null);
    ImportRegistrationImpl i2 = new ImportRegistrationImpl(i1);
    ImportRegistrationImpl i3 = new ImportRegistrationImpl(i2);
    assertEquals(i1, i1.getParent());
    assertEquals(i1, i2.getParent());
    assertEquals(i1, i3.getParent());
    c.verify();
    c.reset();
    closeHandler.onClose(EasyMock.eq(i2));
    EasyMock.expectLastCall().once();
    c.replay();
    i2.close();
    c.verify();
    c.reset();
    closeHandler.onClose(EasyMock.eq(i1));
    EasyMock.expectLastCall().once();
    closeHandler.onClose(EasyMock.eq(i3));
    EasyMock.expectLastCall().once();
    c.replay();
    i3.closeAll();
    c.verify();
}