private List<Task<?>> getTestDiamondTaskGraph(Task<?> providedTask){
    // Note: never instantiate a task without TaskFactory.get() if you're not
    // okay with .equals() breaking. Doing it via TaskFactory.get makes sure
    // that an id is generated, and two tasks of the same type don't show
    // up as "equal", which is important for things like iterating over an
    // array. Without this, DTa, DTb, and DTc would show up as one item in
    // the list of children. Thus, we're instantiating via a helper method
    // that instantiates via TaskFactory.get()
    Task<?> root = getDependencyCollectionTask();
    Task<?> DTa = getDependencyCollectionTask();
    Task<?> DTb = getDependencyCollectionTask();
    Task<?> DTc = getDependencyCollectionTask();
    Task<?> DTd = getDependencyCollectionTask();
    Task<?> DTe = getDependencyCollectionTask();

    root.addDependentTask(DTa);
    root.addDependentTask(DTb);
    root.addDependentTask(DTc);

    DTa.addDependentTask(DTd);
    DTb.addDependentTask(DTd);
    DTc.addDependentTask(DTd);

    DTd.addDependentTask(providedTask);

    providedTask.addDependentTask(DTe);

    List<Task<?>> retVals = new ArrayList<Task<?>>();
    retVals.add(root);
    return retVals;
  }
Generates a task graph that looks like this:

      ---->DTa----
     /            \
root ----->DTb-----*-->DTd---> ProvidedTask --> DTe
     \            /
      ---->DTc----
ql/src/test/org/apache/hadoop/hive/ql/exec/TestUtilities.java