code: private Credential newCredential(String userId) {
          Credential.Builder builder = new Credential.Builder(getMethod())
                  .setTransport(getTransport())
                  .setJsonFactory(getJsonFactory())
                  .setTokenServerEncodedUrl(getTokenServerEncodedUrl())
                  .setClientAuthentication(getClientAuthentication())
                  .setRequestInitializer(getRequestInitializer())
                  .setClock(getClock());
          if (getCredentialStore() != null) {
              builder.addRefreshListener(
                      new CredentialStoreRefreshListener(userId, getCredentialStore()));
          }
  
          builder.getRefreshListeners().addAll(getRefreshListeners());
  
          return builder.build();
      }
docs: Returns a new OAuth 2.0 credential instance based on the given user ID.
  
  @param userId user ID or {@code null} if not using a persisted credential
  store