diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java index 472bbe17d4..4de933dc92 100644 --- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java +++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java @@ -1432,10 +1432,13 @@ public Set> entrySet() { /** * Returns the first entry the {@link org.apache.commons.collections4.Trie} is storing. *

- * This is implemented by going always to the left until - * we encounter a valid uplink. That uplink is the first key. + * This is implemented by going always to the left until we encounter a valid uplink. That uplink is the first key. + *

+ * + * @return the first entry the {@link org.apache.commons.collections4.Trie} is storing. + * @since 4.6.0 */ - TrieEntry firstEntry() { + public TrieEntry firstEntry() { // if Trie is empty, no first node. if (isEmpty()) { return null; @@ -1715,10 +1718,14 @@ public Set keySet() { /** * Returns the last entry the {@link org.apache.commons.collections4.Trie} is storing. * - *

This is implemented by going always to the right until - * we encounter a valid uplink. That uplink is the last key. + *

+ * This is implemented by going always to the right until we encounter a valid uplink. That uplink is the last key. + *

+ * + * @return the last entry the {@link org.apache.commons.collections4.Trie} is storing. + * @since 4.6.0 */ - TrieEntry lastEntry() { + public TrieEntry lastEntry() { return followRight(root.left); }