code: public void postProcess(DirContext ctx) throws NamingException {
  
  		LdapContext ldapContext = (LdapContext) ctx;
  		Control[] responseControls = ldapContext.getResponseControls();
  		if (responseControls == null) {
  			responseControls = new Control[0];
  		}
  
  		// Go through response controls and get info, regardless of class
  		for (int i = 0; i < responseControls.length; i++) {
  			Control responseControl = responseControls[i];
  
  			// check for match, try fallback otherwise
  			if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
  				Object control = responseControl;
  				byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
  				this.cookie = new PagedResultsCookie(result);
  				Integer wrapper = (Integer) invokeMethod("getResultSize", responseControlClass, control);
  				this.resultSize = wrapper.intValue();
  				return;
  			}
  		}
  
  		log.error("No matching response control found for paged results - looking for '{}", responseControlClass);
  	}
docs: /*
  @see
  org.springframework.ldap.core.DirContextProcessor#postProcess(javax.naming
  .directory.DirContext)