@Test
public void testOrderingUsingAppSubmitTime() {

  FairOrderingPolicy<MockSchedulableEntity> policy =
      new FairOrderingPolicy<>();
  policy.setSizeBasedWeight(true);
  MockSchedulableEntity r1 = new MockSchedulableEntity();
  MockSchedulableEntity r2 = new MockSchedulableEntity();
  // R1, R2 has been started at same time
  assertEquals(r1.getStartTime(), r2.getStartTime());
  // No changes, equal
  assertEquals("Comparator Output", 0,
      policy.getComparator().compare(r1, r2));
  // R2 has been started after R1
  r1.setStartTime(5);
  r2.setStartTime(10);
  Assert.assertTrue(policy.getComparator().compare(r1, r2) < 0);
  // R1 has been started after R2
  r1.setStartTime(10);
  r2.setStartTime(5);
  Assert.assertTrue(policy.getComparator().compare(r1, r2) > 0);
}