code: public void disconnect(LDAPConnection ldapConnection) {
  
          // Attempt disconnect
          try {
              ldapConnection.disconnect();
          }
  
          // Warn if disconnect unexpectedly fails
          catch (LDAPException e) {
              logger.warn("Unable to disconnect from LDAP server: {}", e.getMessage());
              logger.debug("LDAP disconnect failed.", e);
          }
  
      }
docs: Disconnects the given LDAP connection, logging any failure to do so
  appropriately.
  
  @param ldapConnection
  The LDAP connection to disconnect.