@Test
public void testDoubleClose() throws Exception {

    final DelegatingLdapContext delegatingLdapContext = new DelegatingLdapContext(
            keyedObjectPoolMock, ldapContextMock, DirContextType.READ_ONLY);
    delegatingLdapContext.close();
    // noop close
    delegatingLdapContext.close();
    verify(keyedObjectPoolMock, times(1)).returnObject(DirContextType.READ_ONLY, ldapContextMock);
}