@Test(dataProvider = "findNodeSearchSet") public void shouldFindNodeFromTestSet(String[] levelValues, int expectedValue) { LevelIndex<Integer> levelIndex = levelIndex().withLevelCount(3).build(); levelIndex.add(new String[]{"A", "B", "C"}, 1); levelIndex.add(new String[]{"A", "B", "*"}, 9); levelIndex.add(new String[]{"A", "E", "D"}, 11); levelIndex.add(new String[]{"A", "*", "D"}, 12); levelIndex.add(new String[]{"A", "*", "*"}, 13); levelIndex.add(new String[]{"*", "Z", "Z"}, 21); levelIndex.add(new String[]{"*", "Z", "*"}, 22); levelIndex.add(new String[]{"*", "*", "*"}, 99); FastLevelIndexWalker<Integer> walker = new FastLevelIndexWalker<Integer>(levelIndex, levelValues); List<Integer> node = walker.find(); assertThat(node).containsExactly(expectedValue); }
@Override public List<T> find() { LevelNode<T> node = find(index.getRoot(), 0); return node != null ? node.getLeafList() : null; }
FastLevelIndexWalker implements LevelIndexWalker<T> { @Override public List<T> find() { LevelNode<T> node = find(index.getRoot(), 0); return node != null ? node.getLeafList() : null; } }
FastLevelIndexWalker implements LevelIndexWalker<T> { @Override public List<T> find() { LevelNode<T> node = find(index.getRoot(), 0); return node != null ? node.getLeafList() : null; } FastLevelIndexWalker(LevelIndex<T> index, String... levelValues); }
FastLevelIndexWalker implements LevelIndexWalker<T> { @Override public List<T> find() { LevelNode<T> node = find(index.getRoot(), 0); return node != null ? node.getLeafList() : null; } FastLevelIndexWalker(LevelIndex<T> index, String... levelValues); @Override List<T> find(); }
FastLevelIndexWalker implements LevelIndexWalker<T> { @Override public List<T> find() { LevelNode<T> node = find(index.getRoot(), 0); return node != null ? node.getLeafList() : null; } FastLevelIndexWalker(LevelIndex<T> index, String... levelValues); @Override List<T> find();  }