@Test
public void testHandleServiceEnvWithNullMap() {

  Service service = createServiceWithEmptyEnvVars();
  org.apache.hadoop.conf.Configuration yarnConfig =
      mock(org.apache.hadoop.conf.Configuration.class);
  EnvironmentUtilities.handleServiceEnvs(service, yarnConfig, null);
  Map<String, String> resultEnvs = service.getConfiguration().getEnv();
  assertEquals(1, resultEnvs.size());
  validateDefaultEnvVars(resultEnvs);
}