CountingItemStage mergeStage = new CountingItemStage<String, String>();
TestSinkStage lhsSink = new TestSinkStage<String>();
TestSinkStage rhsSink = new TestSinkStage<String>();
StreamGraph graph = new StreamGraph();
graph.addHead( source );
graph.addPath( source, lhsStage1 );
graph.addPath( lhsStage1, mergeStage );
graph.addPath( mergeStage, lhsStage2 );
graph.addPath( lhsStage2, lhsSink );
graph.addTail( lhsSink );
graph.addPath( source, rhsStage1 );
graph.addPath( rhsStage1, mergeStage );
graph.addPath( mergeStage, rhsStage2 );
graph.addPath( rhsStage2, rhsSink );
graph.addTail( rhsSink );
graph.bind();
graph.prepare();
source.receiveFirst( null );
graph.cleanup();
assertPrepareCleanup( lhsStage1 );
assertPrepareCleanup( rhsStage1 );
assertEquals( values.size(), lhsStage1.getReceiveCount() );