FifoOrderingPolicy extends AbstractComparatorOrderingPolicy<S> { public FifoOrderingPolicy() { List<Comparator<SchedulableEntity>> comparators = new ArrayList<Comparator<SchedulableEntity>>(); comparators.add(new PriorityComparator()); comparators.add(new FifoComparator()); this.comparator = new CompoundComparator(comparators); this.schedulableEntities = new ConcurrentSkipListSet<S>(comparator); } FifoOrderingPolicy(); @Override void configure(Map<String, String> conf); @Override void containerAllocated(S schedulableEntity, 
    RMContainer r); @Override void containerReleased(S schedulableEntity, 
    RMContainer r); @Override void demandUpdated(S schedulableEntity); @Override String getInfo();  }
@Test public void testFifoOrderingPolicy() { FifoOrderingPolicy<MockSchedulableEntity> policy = new FifoOrderingPolicy<MockSchedulableEntity>(); MockSchedulableEntity r1 = new MockSchedulableEntity(); MockSchedulableEntity r2 = new MockSchedulableEntity(); Assert.assertEquals(policy.getComparator().compare(r1, r2), 0); r1.setSerial(1); Assert.assertEquals(policy.getComparator().compare(r1, r2), 1); r2.setSerial(2); Assert.assertEquals(policy.getComparator().compare(r1, r2), -1); }