code: private static TreeGraphNode safeCast(Object t) {
      if (t == null || !(t instanceof TreeGraphNode)) {
        return null;
      }
      return (TreeGraphNode) t;
    }
docs: Safely casts an <code>Object</code> to a
  <code>TreeGraphNode</code> if possible, else returns
  <code>null</code>.
  
  @param t any <code>Object</code>
  @return <code>t</code> if it is a <code>TreeGraphNode</code>;
  <code>null</code> otherwise