@Test
public void testJoin() {

  final DAGBuilder<IRVertex, IREdge> dagBuilder = new DAGBuilder<>();
  final IRVertex v0 = newVertex(5, 0, Collections.emptyList());
  final IRVertex v1 = newVertex(5, 0, Collections.emptyList());
  final IRVertex v2 = newVertex(5, 0, Collections.emptyList());
  dagBuilder.addVertex(v0);
  dagBuilder.addVertex(v1);
  dagBuilder.addVertex(v2);
  dagBuilder.connectVertices(new IREdge(CommunicationPatternProperty.Value.ONE_TO_ONE, v0, v2));
  dagBuilder.connectVertices(new IREdge(CommunicationPatternProperty.Value.ONE_TO_ONE, v1, v2));
  final Map<IRVertex, Integer> partitioning = stagePartitioner.apply(new IRDAG(dagBuilder.buildWithoutSourceSinkCheck()));
  assertNotEquals(partitioning.get(v0), partitioning.get(v1));
  assertNotEquals(partitioning.get(v1), partitioning.get(v2));
  assertNotEquals(partitioning.get(v2), partitioning.get(v0));
}