code: private static Object resolveVariable (String variableName, Map<String, Object> variables, boolean systemOverrideMode) {
          Object variable = (variables != null) ? variables.get(variableName) : null;
          String environmentValue = System.getenv(variableName);
          String systemValue = System.getProperty(variableName);
          if(systemOverrideMode) {
              return (systemValue != null ? systemValue : (environmentValue != null) ? environmentValue : variable);
          } else {
              return (variable != null ? variable : (systemValue != null) ? systemValue : environmentValue);
          }
         
      }
docs: Helper to {@link #replaceVariables(String, Map, boolean)} which resolves and returns a variable value
  depending on mode.
  
  @param variableName              Name of the variable to find
  @param variables                 Map of variable values
  @param systemOverrideMode        Override = true, Fall back = false
  
  @return The variable value for variableName.