### Question:
TransitiveClosure { public static TransitiveClosure getDownstreamVerticesForCollection(List<Vertex> vertices, boolean includeNonProbabilistic) { Predicate<Vertex> shouldAdd = includeNonProbabilistic ? ADD_ALL : PROBABILISTIC_OR_OBSERVED_ONLY; Set<Vertex> downstreamVertices = getVertices( vertices, Vertex::getChildren, v -> false, shouldAdd ); return new TransitiveClosure(downstreamVertices); } private  TransitiveClosure(Set<Vertex> allVertices); static TransitiveClosure getUpstreamVertices(Vertex<?, ?> aVertex, boolean includeNonProbabilistic); static TransitiveClosure getDownstreamVertices(Vertex<?, ?> aVertex, boolean includeNonProbabilistic); static TransitiveClosure getUpstreamVerticesForCollection(List<Vertex> vertices, boolean includeNonProbabilistic); static TransitiveClosure getDownstreamVerticesForCollection(List<Vertex> vertices, boolean includeNonProbabilistic);  }### Answer:
@Test public void doesGetDownstreamProbabilisticVerticesOfCollection() { TransitiveClosure transitiveClosure = TransitiveClosure.getDownstreamVerticesForCollection(Arrays.asList(A, B), false); assertThat(transitiveClosure.getAllVertices(), containsInAnyOrder(A, C, B)); }
@Test public void doesGetAllDownstreamVerticesOfCollection() { TransitiveClosure transitiveClosure = TransitiveClosure.getDownstreamVerticesForCollection(Arrays.asList(A, B, cSigma), true); assertThat(transitiveClosure.getAllVertices(), containsInAnyOrder(A, B, aPlusB, cSigma, C)); }