### Question:
TransitiveReduction implements Transformation<E, V, Graph<E, V>> { @Override public Graph<E, V> apply(Graph<E, V> graph) { return apply(graph, EdgeFilters.acceptAll(), NodeFilters.acceptAll()); }  @Override Graph<E, V> apply(Graph<E, V> graph); @Override Graph<E, V> apply(Graph<E, V> graph, Predicate<E> edgeFilter, Predicate<V> nodeFilter);  }### Answer:
@Test void ensureTransitiveReductionProducesCorrectEdgeCount() { val result = reduction.apply(graph, EdgeFilters.directionFilter(DirectedGraph.Direction.Incoming)); assertEquals(result.edgeCount(), 5); }
@Test void ensureTransitiveReductionRemovesRedudantEdges() { val result = reduction.apply(graph); assertFalse(result.containsEdge("a", "e"), "edge between a and e must be removed"); assertTrue(graph.containsEdge("a", "e"), "edge between a and e must be preserved in original"); }