DependencyGraph { Stream<DependencyGraphNode> nodeStream() { return Stream.concat( Stream.of(inPortNodes, outPortNodes, submoduleNodes) .map(Stream::of) .flatMap(x -> x), Stream.of(submodulesInPortNodes) .flatMap(Stream::of) ); } DependencyGraph(RuntimeParentModule parentModule, BitSet requestedOutPorts);   }
@Test public void nodeStream() { Set<String> executionTracesOnPath = diamondGraph.nodeStream() .map(DependencyGraphNode::getExecutionTrace) .map(ExecutionTrace::toString) .collect(Collectors.toSet()); Assert.assertEquals( executionTracesOnPath, new HashSet<>(Arrays.asList( ":in:x", ":in:y", "/a", "/a:in:ax", "/a:in:ay", "/b", "/b:in:bx", "/b:in:by", "/c", "/c:in:cx", "/c:in:cy", ":out:p", ":out:q" )) ); }
@Test public void onPathToOutPort() { Set<String> executionTracesOnPath = diamondGraph.nodeStream() .filter(DependencyGraphNode::isOnPathToOutPort) .map(DependencyGraphNode::getExecutionTrace) .map(ExecutionTrace::toString) .collect(Collectors.toSet()); Assert.assertEquals( executionTracesOnPath, new HashSet<>(Arrays.asList( ":in:x", ":in:y", "/a", "/a:in:ax", "/a:in:ay", "/b", "/b:in:bx", "/b:in:by", ":out:p", ":out:q" )) ); }