diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index 13efcb5..5321674 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -108,13 +108,8 @@ public class NodeItem implements Node { */ @Override public boolean isChildOf(final Node node) { - if (node.equals(parent)) { - return true; - } - if (parent != null) { - return parent.isChildOf(node); - } - return false; + return parent != null && (node.equals(parent) || parent.isChildOf( + node)); } /**