boolean (Object object) { if (object == this) return true; // this hack allows to find a node in a map without checking a class type return object instanceof AbstractTreeNode && Comparing.equal(getEqualityObject(), ((AbstractTreeNode<?>)object).getEqualityObject()); }