boolean (Container child, Container ancestor) { if (child == null) { return false; } if (ancestor == null) { return true; } if (child.getParent() == ancestor) { return true; } return <caret>hasAncestor(child.getParent(), ancestor); }