@Test public void trivialSchedulingWorksForEmptyStates() { SchedulingStrategy strategy = makeTrivialSchedulingStrategy(); List<SlotState> states = new LinkedList<SlotState>(); List<SlotState> slots = strategy.getSchedulingCandidates(states); Assert.assertEquals(slots.size(), 0); }
public List<SlotState> getSchedulingCandidates(List<SlotState> states) { List<SlotState> candidates = new LinkedList<SlotState>(); for (SlotState slotState : states) { if (slotState.getStatus() == SlotState.Status.READY) { candidates.add(slotState); } } return candidates; }
TrivialSchedulingStrategy implements SchedulingStrategy { public List<SlotState> getSchedulingCandidates(List<SlotState> states) { List<SlotState> candidates = new LinkedList<SlotState>(); for (SlotState slotState : states) { if (slotState.getStatus() == SlotState.Status.READY) { candidates.add(slotState); } } return candidates; } }
TrivialSchedulingStrategy implements SchedulingStrategy { public List<SlotState> getSchedulingCandidates(List<SlotState> states) { List<SlotState> candidates = new LinkedList<SlotState>(); for (SlotState slotState : states) { if (slotState.getStatus() == SlotState.Status.READY) { candidates.add(slotState); } } return candidates; } TrivialSchedulingStrategy(); }
TrivialSchedulingStrategy implements SchedulingStrategy { public List<SlotState> getSchedulingCandidates(List<SlotState> states) { List<SlotState> candidates = new LinkedList<SlotState>(); for (SlotState slotState : states) { if (slotState.getStatus() == SlotState.Status.READY) { candidates.add(slotState); } } return candidates; } TrivialSchedulingStrategy(); List<SlotState> getSchedulingCandidates(List<SlotState> states); }
TrivialSchedulingStrategy implements SchedulingStrategy { public List<SlotState> getSchedulingCandidates(List<SlotState> states) { List<SlotState> candidates = new LinkedList<SlotState>(); for (SlotState slotState : states) { if (slotState.getStatus() == SlotState.Status.READY) { candidates.add(slotState); } } return candidates; } TrivialSchedulingStrategy(); List<SlotState> getSchedulingCandidates(List<SlotState> states);  }