### Question:
Trie { public boolean containsNode(String word) { TrieNode current = root; for (int i = 0; i < word.length(); i++) { char ch = word.charAt(i); TrieNode node = current.getChildren().get(ch); if (node == null) { return false; } current = node; } return current.isEndOfWord(); } Trie(); void insert(String word); boolean delete(String word); boolean containsNode(String word); boolean isEmpty();  }### Answer:
@Test public void givenATrie_whenAddingElements_thenTrieHasThoseElements() { Trie trie = createExampleTrie(); assertFalse(trie.containsNode("3")); assertFalse(trie.containsNode("vida")); assertTrue(trie.containsNode("Programming")); assertTrue(trie.containsNode("is")); assertTrue(trie.containsNode("a")); assertTrue(trie.containsNode("way")); assertTrue(trie.containsNode("of")); assertTrue(trie.containsNode("life")); }
@Test public void givenATrie_whenLookingForNonExistingElement_thenReturnsFalse() { Trie trie = createExampleTrie(); assertFalse(trie.containsNode("99")); }