code: private static String getSystemVariableValue(String variableName, String defaultValue) {
          String value;
          if (System.getProperty(variableName) != null) {
              value = System.getProperty(variableName);
          } else if (System.getenv(variableName) != null) {
              value = System.getenv(variableName);
          } else {
              value = defaultValue;
          }
          return value;
      }
docs: A utility which allows reading variables from the environment or System properties.
  If the variable in available in the environment as well as a System property, the System property takes
  precedence.
  
  @param variableName System/environment variable name
  @param defaultValue default value to be returned if the specified system variable is not specified.
  @return value of the system/environment variable