code: @Override
      public boolean validForState(ImapSessionState state) {
          return state == ImapSessionState.AUTHENTICATED
                  || state == ImapSessionState.SELECTED;
      }
docs: Check that the state is {@link ImapSessionState#AUTHENTICATED } or
  {@link ImapSessionState#SELECTED}