public static List<String> getJavaOpts(Configuration conf) {
    String adminOpts = conf.get(YarnConfiguration.NM_CONTAINER_LOCALIZER_ADMIN_JAVA_OPTS_KEY,
        YarnConfiguration.NM_CONTAINER_LOCALIZER_ADMIN_JAVA_OPTS_DEFAULT);
    String userOpts = conf.get(YarnConfiguration.NM_CONTAINER_LOCALIZER_JAVA_OPTS_KEY,
        YarnConfiguration.NM_CONTAINER_LOCALIZER_JAVA_OPTS_DEFAULT);

    boolean isExtraJDK17OptionsConfigured =
        conf.getBoolean(YarnConfiguration.NM_CONTAINER_LOCALIZER_JAVA_OPTS_ADD_EXPORTS_KEY,
        YarnConfiguration.NM_CONTAINER_LOCALIZER_JAVA_OPTS_ADD_EXPORTS_DEFAULT);

    if (Shell.isJavaVersionAtLeast(17) && isExtraJDK17OptionsConfigured) {
      userOpts = userOpts.trim().concat(" " + ADDITIONAL_JDK17_PLUS_OPTIONS);
    }

    List<String> adminOptionList = Arrays.asList(adminOpts.split("\\s+"));
    List<String> userOptionList = Arrays.asList(userOpts.split("\\s+"));

    return Stream.concat(adminOptionList.stream(), userOptionList.stream())
        .filter(s -> !s.isEmpty())
        .collect(Collectors.toList());
  }
@Test
  public void testJavaOptionsWithoutDefinedAdminOrUserOptions() throws Exception {
    ContainerLocalizerWrapper wrapper = new ContainerLocalizerWrapper();
    ContainerLocalizer localizer = wrapper.setupContainerLocalizerForTest();

    Configuration conf = new Configuration();
    List<String> javaOpts = localizer.getJavaOpts(conf);

    Assert.assertEquals(1, javaOpts.size());
    Assert.assertTrue(javaOpts.get(0).equals("-Xmx256m"));
  }