code: public Credential getCredential() {
      if (hasStoredCredential()) {
        HttpTransport httpTransport;
        try {
          httpTransport = GoogleNetHttpTransport.newTrustedTransport();
        } catch (IOException | GeneralSecurityException e) {
          throw new RuntimeException("Could not create HTTPS transport for use in credential creation", e);
        }
  
        return new GoogleCredential.Builder()
        .setJsonFactory(JacksonFactory.getDefaultInstance())
        .setTransport(httpTransport)
        .setClientSecrets(getClientId(), getClientSecret())
        .build()
        .setRefreshToken(getRefreshToken());
      }
      return CredentialFactory.getApplicationDefaultCredential();
    }
docs: Return the stored user credential, if applicable, or fall back to the Application Default Credential.
  
  @return The com.google.api.client.auth.oauth2.Credential object.