code: @Override
      public synchronized AccessToken getOAuthAccessToken() throws TwitterException {
          Authorization auth = getAuthorization();
          AccessToken oauthAccessToken;
          if (auth instanceof BasicAuthorization) {
              BasicAuthorization basicAuth = (BasicAuthorization) auth;
              auth = AuthorizationFactory.getInstance(conf);
              if (auth instanceof OAuthAuthorization) {
                  this.auth = auth;
                  OAuthAuthorization oauthAuth = (OAuthAuthorization) auth;
                  oauthAccessToken = oauthAuth.getOAuthAccessToken(basicAuth.getUserId(), basicAuth.getPassword());
              } else {
                  throw new IllegalStateException("consumer key / secret combination not supplied.");
              }
          } else {
              if (auth instanceof XAuthAuthorization) {
                  XAuthAuthorization xauth = (XAuthAuthorization) auth;
                  this.auth = xauth;
                  OAuthAuthorization oauthAuth = new OAuthAuthorization(conf);
                  oauthAuth.setOAuthConsumer(xauth.getConsumerKey(), xauth.getConsumerSecret());
                  oauthAccessToken = oauthAuth.getOAuthAccessToken(xauth.getUserId(), xauth.getPassword());
              } else {
                  oauthAccessToken = getOAuth().getOAuthAccessToken();
              }
          }
          screenName = oauthAccessToken.getScreenName();
          id = oauthAccessToken.getUserId();
          return oauthAccessToken;
      }
docs: {@inheritDoc}
  Basic authenticated instance of this class will try acquiring an AccessToken using xAuth.<br>
  In order to get access acquire AccessToken using xAuth, you must apply by sending an email to <a href="mailto:api@twitter.com">api@twitter.com</a> all other applications will receive an HTTP 401 error.  Web-based applications will not be granted access, except on a temporary basis for when they are converting from basic-authentication support to full OAuth support.<br>
  Storage of Twitter usernames and passwords is forbidden. By using xAuth, you are required to store only access tokens and access token secrets. If the access token expires or is expunged by a user, you must ask for their login and password again before exchanging the credentials for an access token.
  
  @throws TwitterException When Twitter service or network is unavailable, when the user has not authorized, or when the client application is not permitted to use xAuth
  @see <a href="https://dev.twitter.com/docs/oauth/xauth">xAuth | Twitter Developers</a>