@Override
    public void destroy() {
        connectionFactoryList.forEach((ldap, connectionFactory) ->
            connectionFactory.close()
        );
    }
Search ldap for id and return optional.

@param ldap the ldap
@param id   the id
@return the optional
@throws Exception the exception
support/cas-server-support-aup-ldap/src/main/java/org/apereo/cas/aup/LdapAcceptableUsagePolicyRepository.java