code: @SuppressWarnings("deprecation")
    public static Map<String, String> getEnvironmentVariables(Configuration yarnConfiguration) {
      Map<String, String> environmentVariableMap = Maps.newHashMap();
  
      if (System.getenv().containsKey(ApplicationConstants.Environment.JAVA_HOME.key())) {
        Apps.addToEnvironment(environmentVariableMap, ApplicationConstants.Environment.JAVA_HOME.key(),
            System.getenv(ApplicationConstants.Environment.JAVA_HOME.key()));
      }
  
      // Add jars/files in the working directory of the ApplicationMaster to the CLASSPATH
      Apps.addToEnvironment(environmentVariableMap, ApplicationConstants.Environment.CLASSPATH.key(),
          ApplicationConstants.Environment.PWD.$());
      Apps.addToEnvironment(environmentVariableMap, ApplicationConstants.Environment.CLASSPATH.key(),
          ApplicationConstants.Environment.PWD.$() + File.separator + "*");
  
      String[] classpaths = yarnConfiguration.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
          YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH);
      if (classpaths != null) {
        for (String classpath : classpaths) {
          Apps.addToEnvironment(
              environmentVariableMap, ApplicationConstants.Environment.CLASSPATH.key(), classpath.trim());
        }
      }
  
      return environmentVariableMap;
    }
docs: Get environment variables in a {@link java.util.Map} used when launching a Yarn container.
  
  @param yarnConfiguration a Hadoop {@link Configuration} object carrying Hadoop/Yarn configuration properties
  @return a {@link java.util.Map} storing environment variables used when launching a Yarn container