Container taskDO = (Container)task.getDirectObject (); Container examinedDO = (Container)examinedTask.getDirectObject ();
Container taskDO; if (task.getDirectObject() instanceof AssetGroup) { taskDO= (Container) ((AssetGroup) task.getDirectObject()).getAssets().iterator().next(); } else { taskDO = (Container)task.getDirectObject (); }  Container examinedDO; if (examinedTask.getDirectObject() instanceof AssetGroup) { examinedDO= (Container) ((AssetGroup) examinedTask.getDirectObject()).getAssets().iterator().next(); } else { examinedDO = (Container)examinedTask.getDirectObject (); }
  protected boolean contentTypesOverlap (Task task, Task examinedTask){    Container taskDO = (Container)task.getDirectObject ();    Container examinedDO = (Container)examinedTask.getDirectObject ();    ContentsPG contents = taskDO.getContentsPG ();    Collection typeIDs  = contents.getTypeIdentifications ();    ContentsPG examinedContents = examinedDO.getContentsPG ();    Collection examinedTypeIDs  = examinedContents.getTypeIdentifications ();    Collection copy = new ArrayList (examinedTypeIDs);    copy.retainAll (typeIDs);    if (copy.isEmpty()) {      if (isDebugEnabled())	debug ("skipping transport task where type ids don't match. No overlap between examined container " + 	       examinedTypeIDs + 	       " and other container's list " + typeIDs);      return false;    }    else {      return true;    }  }