### Question:
SerialScheduler implements Transformation<E, V, Schedule<E, V>> { @Override public Schedule<E, V> apply(Graph<E, V> graph) { return toSchedule(sort.apply(graph)); } SerialScheduler(); @Override Schedule<E, V> apply(Graph<E, V> graph); @Override Schedule<E, V> apply(Graph<E, V> graph, Predicate<E> edgeFilter, Predicate<V> nodeFilter);  }### Answer:
@Test void ensureComplexTaskIsScheduledCorrectly() { graph.connect("5", "11", outgoing("5 -> 11")); graph.connect("11", "2", outgoing("11 -> 2")); graph.connect("7", "11", outgoing("7 -> 11")); graph.connect("7", "8", outgoing("7 -> 8")); graph.connect("3", "8", outgoing("3 -> 8")); graph.connect("3", "10", outgoing("3 -> 10")); graph.connect("11", "9", outgoing("11 -> 9")); graph.connect("8", "9", outgoing("8 -> 9")); graph.connect("11", "10", outgoing("11 -> 10")); val schedule = scheduler.apply(graph); assertEquals(schedule.getTasks().size(), graph.vertexCount()); }
@Test void ensureAllElementsArePresentInSchedule() { c("1", "0"); c("2", "1"); c("0", "3"); c("3", "4"); val g = scheduler.apply(graph); assertEquals(g.size(), 5); }