@Test(expected = IllegalStateException.class) public void testPutInternal_InvalidClassification() { class InvalidSearchResult extends ConcurrentRadixTree.SearchResult { InvalidSearchResult(CharSequence key, Node nodeFound, int charsMatched, int charsMatchedInNodeFound, Node parentNode, Node parentNodesParent) { super(key, nodeFound, charsMatched, charsMatchedInNodeFound, parentNode, parentNodesParent); } @Override protected Classification classify(CharSequence key, Node nodeFound, int charsMatched, int charsMatchedInNodeFound) { return Classification.INVALID; } } ConcurrentRadixTree<Integer> tree = new ConcurrentRadixTree<Integer>(getNodeFactory()) { @Override SearchResult searchTree(CharSequence key) { return new InvalidSearchResult("FOO", root, 4, 4, null, null); } }; tree.put("FOO", 1); }
@Override public O put(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, true); return existingValue; }
ConcurrentRadixTree implements RadixTree<O>, PrettyPrintable, Serializable { @Override public O put(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, true); return existingValue; } }
ConcurrentRadixTree implements RadixTree<O>, PrettyPrintable, Serializable { @Override public O put(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, true); return existingValue; } ConcurrentRadixTree(NodeFactory nodeFactory); }
ConcurrentRadixTree implements RadixTree<O>, PrettyPrintable, Serializable { @Override public O put(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, true); 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(); }
ConcurrentRadixTree implements RadixTree<O>, PrettyPrintable, Serializable { @Override public O put(CharSequence key, O value) { @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) O existingValue = (O) putInternal(key, value, true); 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();  }