@Test (timeout = 5000)
public void testApplicationComparator()
{

  CapacityScheduler cs = new CapacityScheduler();
  Comparator<FiCaSchedulerApp> appComparator= cs.getApplicationComparator();
  ApplicationId id1 = ApplicationId.newInstance(1, 1);
  ApplicationId id2 = ApplicationId.newInstance(1, 2);
  ApplicationId id3 = ApplicationId.newInstance(2, 1);
  //same clusterId
  FiCaSchedulerApp app1 = Mockito.mock(FiCaSchedulerApp.class);
  when(app1.getApplicationId()).thenReturn(id1);
  FiCaSchedulerApp app2 = Mockito.mock(FiCaSchedulerApp.class);
  when(app2.getApplicationId()).thenReturn(id2);
  FiCaSchedulerApp app3 = Mockito.mock(FiCaSchedulerApp.class);
  when(app3.getApplicationId()).thenReturn(id3);
  assertTrue(appComparator.compare(app1, app2) < 0);
  //different clusterId
  assertTrue(appComparator.compare(app1, app3) < 0);
  assertTrue(appComparator.compare(app2, app3) < 0);
}