### Question:
RadixTreeImpl implements RadixTree<T>, Formattable { public boolean delete(String key) { Visitor<T, Boolean> visitor = new VisitorImpl<T, Boolean>(Boolean.FALSE) { public void visit(String key, RadixTreeNode<T> parent, RadixTreeNode<T> node) { result = node.isReal(); if (result) { if (node.getChildern().size() == 0) { Iterator<RadixTreeNode<T>> it = parent.getChildern() .iterator(); while (it.hasNext()) { if (it.next().getKey().equals(node.getKey())) { it.remove(); break; } } if (parent.getChildern().size() == 1 && parent.isReal() == false) { mergeNodes(parent, parent.getChildern().get(0)); } } else if (node.getChildern().size() == 1) { mergeNodes(node, node.getChildern().get(0)); } else { node.setReal(false); } } } private void mergeNodes(RadixTreeNode<T> parent, RadixTreeNode<T> child) { parent.setKey(parent.getKey() + child.getKey()); parent.setReal(child.isReal()); parent.setValue(child.getValue()); parent.setChildern(child.getChildern()); } }; visit(key, visitor); if(visitor.getResult()) { size--; } return visitor.getResult().booleanValue(); } RadixTreeImpl(); T find(String key); boolean delete(String key); void insert(String key, T value); ArrayList<T> searchPrefix(String key, int recordLimit); boolean contains(String key); void visit(String key, Visitor<T, R> visitor); long getSize(); @Deprecated void display(); @Override void formatTo(Formatter formatter, int flags, int width, int precision); String complete(String prefix);  }### Answer:
@Test public void testCantDeleteSomethingThatDoesntExist() { RadixTreeImpl<String> trie = new RadixTreeImpl<String>(); assertFalse(trie.delete("apple")); }