Task parent = (Task) childToParent.get(child); if (parent != null) return parent;
Task parent = (Task) uidToTask.get (child.getParentTaskUID ());
  protected Task getParentTask (final Task child) {    Task parent = (Task) childToParent.get(child); // use a cache since query is expensive    if (parent != null)      return parent;    Collection parents = blackboard.query (new UnaryPredicate () {        public boolean execute (Object obj) {          if (obj instanceof Task) {            return (((Task) obj).getUID().equals (child.getParentTaskUID()));          }          else return false;        }      });    if (parents.isEmpty())       return null;    parent = (Task) parents.iterator().next(); // only one parent - not an MPTask    childToParent.put (child, parent);    return parent;  }