List<TezOperator> roots = compiledPlan.first.getRoots();
assertEquals(2, roots.size());
List<TezOperator> leaves = compiledPlan.first.getLeaves();
assertEquals(1, leaves.size());
Vertex root0 = compiledPlan.second.getVertex(roots.get(0).getOperatorKey().toString());
Vertex root1 = compiledPlan.second.getVertex(roots.get(1).getOperatorKey().toString());
assertNotNull(root0);
assertNotNull(root1);
assertEquals(0, root0.getInputVertices().size());
assertEquals(1, root1.getOutputVertices().size());
Vertex leaf = compiledPlan.second.getVertex(leaves.get(0).getOperatorKey().toString());
assertNotNull(leaf);
assertEquals(2, leaf.getInputVertices().size());
assertEquals(0, leaf.getOutputVertices().size());
assertEquals(root0.getOutputVertices().get(0), leaf);
assertEquals(root1.getOutputVertices().get(0), leaf);
assertTrue(leaf.getInputVertices().contains(root0));
assertTrue(leaf.getInputVertices().contains(root1));
}