@Test
public void testMerge2UAM() {

  AppsInfo apps = new AppsInfo();
  AppInfo app1 = new AppInfo();
  app1.setAppId(APPID1.toString());
  app1.setName(UnmanagedApplicationManager.APP_NAME);
  app1.setState(YarnApplicationState.RUNNING);
  apps.add(app1);
  AppInfo app2 = new AppInfo();
  app2.setAppId(APPID1.toString());
  app2.setName(UnmanagedApplicationManager.APP_NAME);
  app2.setState(YarnApplicationState.RUNNING);
  apps.add(app2);
  AppsInfo result = RouterWebServiceUtil.mergeAppsInfo(apps.getApps(), false);
  Assert.assertNotNull(result);
  Assert.assertEquals(0, result.getApps().size());
  // By enabling partial result, the expected result would be a partial report
  // of the 2 UAMs
  AppsInfo result2 = RouterWebServiceUtil.mergeAppsInfo(apps.getApps(), true);
  Assert.assertNotNull(result2);
  Assert.assertEquals(1, result2.getApps().size());
  Assert.assertEquals(YarnApplicationState.RUNNING,
      result2.getApps().get(0).getState());
}