docs: public static <T> T doWithSingleContext(ContextSource contextSource,
                                              LdapOperationsCallback<T> callback,
                                              boolean useReadOnly,
                                              boolean ignorePartialResultException,
                                              boolean ignoreNameNotFoundException) {
          SingleContextSource singleContextSource;
          if (useReadOnly) {
              singleContextSource = new SingleContextSource(contextSource.getReadOnlyContext());
          } else {
              singleContextSource = new SingleContextSource(contextSource.getReadWriteContext());
          }
  
          LdapTemplate ldapTemplate = new LdapTemplate(singleContextSource);
          ldapTemplate.setIgnorePartialResultException(ignorePartialResultException);
          ldapTemplate.setIgnoreNameNotFoundException(ignoreNameNotFoundException);
  
          try {
              return callback.doWithLdapOperations(ldapTemplate);
          } finally {
              singleContextSource.destroy();
          }
      }