code: private void arrangeCallbacks(Callback[] callbacks) {
          if (callbacks[0] instanceof CallerPrincipalCallback)
              return;
  
          int length = callbacks.length;
          for (int i = 0; i < length; i++) {
              if (callbacks[i] instanceof CallerPrincipalCallback) {
                  Callback callback = callbacks[0];
                  callbacks[0] = callbacks[i];
                  callbacks[i] = callback;
                  break;
              }
          }
      }
docs: This method is called to ensure that the first callback is always a CallerPrincipalCallback
  irrespective of the order in which the callbacks are passed in by the resource adapter.
  If we need to return false to the PasswordValidationCallback when the name passed in by the
  CallerPrincipalCallback is different from the one set in the PasswordValidationCallback, the
  PasswordValidationCallback should always be processed after the CallerPrincipalCallback.
  
  @param callbacks