diff --git a/src/main/java/net/kemitix/node/Node.java b/src/main/java/net/kemitix/node/Node.java index 3e70032..4a0e67a 100644 --- a/src/main/java/net/kemitix/node/Node.java +++ b/src/main/java/net/kemitix/node/Node.java @@ -256,5 +256,5 @@ public interface Node { * * @return a stream of the node's parents recursively until the root node */ - Stream> streamParents(); + Stream> parentStream(); } diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index 5b75c0a..d876c8f 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -377,8 +377,8 @@ class NodeItem implements Node { } @Override - public Stream> streamParents() { - return getParent().map(node -> Stream.concat(Stream.of(node), node.streamParents())) - .orElseGet(Stream::empty); + public Stream> parentStream() { + return findParent().map(node -> Stream.concat(Stream.of(node), node.parentStream())) + .orElseGet(Stream::empty); } }