code: static TokenLifeCycleManager getInstance(final String jsonCredentials) {
          final JsonObject credentials = new JsonParser().parse(jsonCredentials)
                  .getAsJsonObject();
          if(credentials.get("apikey")==null || credentials.get("apikey").isJsonNull()||credentials.get("apikey").getAsString().isEmpty()) {
              throw new IllegalArgumentException(
                      "IAM API Key value is either not available, or null or is empty in credentials JSON.");
          }
          if(credentials.get("iam_endpoint")==null || credentials.get("iam_endpoint").isJsonNull()||credentials.get("iam_endpoint").getAsString().isEmpty()) {
              throw new IllegalArgumentException(
                      "IAM endpoint Key value is either not available, or null or is empty in credentials JSON.");
          }
          final String apiKey = credentials.get("apikey").getAsString();
          final String iamEndpoint = credentials.get("iam_endpoint").getAsString();
  
          return getInstanceUnchecked(iamEndpoint, apiKey);
      }
docs: Get an instance of TokenLifeCylceManager. Single instance is maintained
  for each unique pair of iamEndpoint and apiKey. The method and the returned instance is thread
  safe.
  
  @param jsonCredentials
  Credentials in JSON format. The credentials should at minimum
  have these <key>:<value> pairs in the credentials json:
  {
  "apikey":"<IAM_API_KEY>",
  "iam_endpoint":"<IAM_ENDPOINT>"
  }
  @return Instance of TokenLifeCylceManager.