@Test
public void testDoubleClose() throws Exception {

    final DelegatingDirContext delegatingDirContext = new DelegatingDirContext(
            keyedObjectPoolMock, dirContextMock, DirContextType.READ_ONLY);
    delegatingDirContext.close();
    // noop close
    delegatingDirContext.close();
    verify(keyedObjectPoolMock, times(1)).returnObject(DirContextType.READ_ONLY, dirContextMock);
}