code: final GoogleCredential getDefaultCredential(HttpTransport transport, JsonFactory jsonFactory)
        throws IOException {
      synchronized (this) {
        if (cachedCredential == null) {
          cachedCredential = getDefaultCredentialUnsynchronized(transport, jsonFactory);
        }
        if (cachedCredential != null) {
          return cachedCredential;
        }
      }
  
      throw new IOException(String.format(
          "The Application Default Credentials are not available. They are available if running "
              + "on Google App Engine, Google Compute Engine, or Google Cloud Shell. Otherwise, "
              + "the environment variable %s must be defined pointing to a file defining "
              + "the credentials. See %s for more information.",
          CREDENTIAL_ENV_VAR,
          HELP_PERMALINK));
    }
docs: {@link Beta} <br/>
  Returns the Application Default Credentials.
  
  <p>Returns the Application Default Credentials which are credentials that identify and
  authorize the whole application. This is the built-in service account if running on Google
  Compute Engine or the credentials file from the path in the environment variable
  GOOGLE_APPLICATION_CREDENTIALS.</p>
  
  @param transport the transport for Http calls.
  @param jsonFactory the factory for Json parsing and formatting.
  @return the credential instance.
  @throws IOException if the credential cannot be created in the current environment.