ConcurrentRadixTree implements RadixTree<O>, PrettyPrintable, Serializable { @Override public O putIfAbsent(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, false); return existingValue; } ConcurrentRadixTree(NodeFactory nodeFactory); @Override O put(CharSequence key, O value); @Override O putIfAbsent(CharSequence key, O value); @Override O getValueForExactKey(CharSequence key); @Override Iterable<CharSequence> getKeysStartingWith(CharSequence prefix); @Override Iterable<O> getValuesForKeysStartingWith(CharSequence prefix); @Override Iterable<KeyValuePair<O>> getKeyValuePairsForKeysStartingWith(CharSequence prefix); @Override boolean remove(CharSequence key); @Override Iterable<CharSequence> getClosestKeys(CharSequence candidate); @Override Iterable<O> getValuesForClosestKeys(CharSequence candidate); @Override Iterable<KeyValuePair<O>> getKeyValuePairsForClosestKeys(CharSequence candidate); @Override int size(); @Override Node getNode();  }
@Test public void testPutIfAbsent_SplitNode() { ConcurrentRadixTree<Integer> tree = new ConcurrentRadixTree<Integer>(getNodeFactory()); Integer existing; existing = tree.putIfAbsent("FOOBAR", 1); assertNull(existing); existing = tree.putIfAbsent("FOOD", 1); assertNull(existing); existing = tree.putIfAbsent("FOO", 2); assertNull(existing); }