ConcurrentReversedRadixTree implements ReversedRadixTree<O>, PrettyPrintable, Serializable { @Override public Iterable<O> getValuesForKeysEndingWith(CharSequence suffix) { return radixTree.getValuesForKeysStartingWith(CharSequences.reverse(suffix)); } ConcurrentReversedRadixTree(NodeFactory nodeFactory); @Override O getValueForExactKey(CharSequence key); @Override O put(CharSequence key, O value); @Override O putIfAbsent(CharSequence key, O value); @Override Iterable<CharSequence> getKeysEndingWith(CharSequence suffix); @Override Iterable<O> getValuesForKeysEndingWith(CharSequence suffix); @Override Iterable<KeyValuePair<O>> getKeyValuePairsForKeysEndingWith(CharSequence suffix); @Override boolean remove(CharSequence key); @Override int size(); @Override Node getNode();  }
@Test public void testGetValuesForKeysEndingWith() throws Exception { ConcurrentReversedRadixTree<Integer> tree = new ConcurrentReversedRadixTree<Integer>(getNodeFactory()); tree.put("TEST", 1); tree.put("TEAM", 2); tree.put("TOAST", 3); assertEquals("[3, 1]", Iterables.toString(tree.getValuesForKeysEndingWith("ST"))); assertEquals("[2]", Iterables.toString(tree.getValuesForKeysEndingWith("M"))); assertEquals("[2, 3, 1]", Iterables.toString(tree.getValuesForKeysEndingWith(""))); assertEquals("[]", Iterables.toString(tree.getValuesForKeysEndingWith("Z"))); }