@Test
public void testOffersSorted() throws Exception {
// Ensures that non-DRAINING offers are preferred - the DRAINING offer would be tried last.
HostOffer offerA = setMode(OFFER_A, DRAINING);
HostOffer offerC = setMode(OFFER_C, DRAINING);
TaskInfo task = TaskInfo.getDefaultInstance();
expect(offerAcceptor.apply(OFFER_B)).andReturn(Optional.of(task));
driver.launchTask(OFFER_B.getOffer().getId(), task);
driver.declineOffer(offerA.getOffer().getId());
driver.declineOffer(offerC.getOffer().getId());
control.replay();
offerQueue.addOffer(offerA);
offerQueue.addOffer(OFFER_B);