code: public static ServiceAccount getInstance() {
          ServiceAccount account = getInstanceByEnvVars();
          if (account == null) {
              Map<String, String> env = System.getenv();
              String serviceName = env.get(GP_SERVICE_NAME);
              String serviceInstanceName = env.get(GP_SERVICE_INSTANCE_NAME);
              account = getInstanceByVcapServices(serviceName, serviceInstanceName);
          }
          return account;
      }
docs: Returns an instance of ServiceAccount. This factory method tries below in order.
  <ol>
  <li>Checks environment variables <code>GP_URL</code> (service URL - e.g.
  https://gp-rest.ng.bluemix.net/translate/rest), <code>GP_INSTANCE_ID</code>
  (service instance ID - e.g. d3f537cd617f34c86ac6b270f3065e73),
  <code>GP_USER_ID</code> (user ID - e.g. e92a1282a0e4f97bec93aa9f56fdb838)
  and <code>GP_PASSWORD</code> (password - e.g. zg5SlD+ftXYRIZDblLgEA/ILkkCNqE1y).
  If all of above are defined, this method calls
  {@link #getInstance(String, String, String, String)} with these environment
  variable values.</li>
  
  <li>Checks <code>VCAP_SERVICES</code> environment variable. If the variable
  is defined and an entry for IBM Globalization Pipeline service is available,
  use the values in the JSON <code>credentials</code> object. When multiple entries
  for IBM Globalization Pipeline service are found, the first one will be used.
  unless <code>GP_SERVICE_NAME</code> and/or <code>GP_SERVICE_INSTANCE_NAME</code>
  are not defined.</li>
  
  <li>If both of above failed, returns null.</li>
  </ol>
  @return  An instance of ServiceAccount, or null if service configuration is
  not available.