### Question:
TransitiveClosure { public static TransitiveClosure getUpstreamVertices(Vertex<?, ?> aVertex, boolean includeNonProbabilistic) { return getUpstreamVerticesForCollection(Collections.singletonList(aVertex), includeNonProbabilistic); } 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 doesGetUpstreamProbabilisticVertices() { TransitiveClosure transitiveClosure = TransitiveClosure.getUpstreamVertices(C, false); assertThat(transitiveClosure.getAllVertices(), containsInAnyOrder(A, B, C)); }
@Test public void doesGetAllUpstreamVertices() { TransitiveClosure transitiveClosure = TransitiveClosure.getUpstreamVertices(C, true); assertThat(transitiveClosure.getAllVertices(), containsInAnyOrder(Amu, Asigma, Bmu, Bsigma, A, B, aPlusB, cSigma, C)); }