@Test
public void testMemoryIncrementConfiguredViaMultipleProperties() {

  TestAppender testAppender = new TestAppender();
  Logger logger = LogManager.getRootLogger();
  logger.addAppender(testAppender);
  try {
    Configuration conf = new Configuration();
    conf.set("yarn.scheduler.increment-allocation-mb", "7");
    conf.set(YarnConfiguration.RESOURCE_TYPES + "." +
        ResourceInformation.MEMORY_MB.getName() +
        FairSchedulerConfiguration.INCREMENT_ALLOCATION, "13");
    FairSchedulerConfiguration fsc = new FairSchedulerConfiguration(conf);
    Resource increment = fsc.getIncrementAllocation();
    Assert.assertEquals(13L, increment.getMemorySize());
    assertTrue("Warning message is not logged when specifying memory " +
        "increment via multiple properties",
        testAppender.getLogEvents().stream().anyMatch(
          e -> e.getLevel() == Level.WARN && ("Configuration " +
            "yarn.resource-types.memory-mb.increment-allocation=13 is " +
            "overriding the yarn.scheduler.increment-allocation-mb=7 " +
            "property").equals(e.getMessage())));
  } finally {
    logger.removeAppender(testAppender);
  }
}