@Test public void getBuildChainWithEmptyGraphShouldReturnEmpty() { DependencyGraph<Commit> graph = new DependencyGraph<>(m -> null); assertThat(graph.getBuildChain()).isEmpty(); }
public Stream<T> getBuildChain() throws CycleDetectedException { DefaultDirectedGraph<T, DefaultEdge> graph = builder.build(); ensureNoCycle(graph); return Iterators.toStream(new TopologicalOrderIterator<>(graph)); }
DependencyGraph { public Stream<T> getBuildChain() throws CycleDetectedException { DefaultDirectedGraph<T, DefaultEdge> graph = builder.build(); ensureNoCycle(graph); return Iterators.toStream(new TopologicalOrderIterator<>(graph)); } }
DependencyGraph { public Stream<T> getBuildChain() throws CycleDetectedException { DefaultDirectedGraph<T, DefaultEdge> graph = builder.build(); ensureNoCycle(graph); return Iterators.toStream(new TopologicalOrderIterator<>(graph)); } DependencyGraph(Function<T, Optional<T>> getParent); }
DependencyGraph { public Stream<T> getBuildChain() throws CycleDetectedException { DefaultDirectedGraph<T, DefaultEdge> graph = builder.build(); ensureNoCycle(graph); return Iterators.toStream(new TopologicalOrderIterator<>(graph)); } DependencyGraph(Function<T, Optional<T>> getParent); void registerItem(T item); Stream<T> getBuildChain(); String toString(); }
DependencyGraph { public Stream<T> getBuildChain() throws CycleDetectedException { DefaultDirectedGraph<T, DefaultEdge> graph = builder.build(); ensureNoCycle(graph); return Iterators.toStream(new TopologicalOrderIterator<>(graph)); } DependencyGraph(Function<T, Optional<T>> getParent); void registerItem(T item); Stream<T> getBuildChain(); String toString();  }