### Question:
SelectorNodeSelector implements NodeSelector<E> { @Override public <N extends OpenNode<E, ? extends N>> Iterator<? extends N> select(Tree<E, ? extends N> tree) { final Iterator<? extends N> startingPoints = baseSelector.select(tree); final Iterator<? extends N> children = new NodeChildrenIterator<>(startingPoints, new AlwaysMatcher<>()); return new NodeSelectionIterator<>(children, extensionSelector); } SelectorNodeSelector(NodeSelector<E> baseSelector, NodeSelector<E> extensionSelector); @Override Iterator<? extends N> select(Tree<E, ? extends N> tree);  }### Answer:
@Test public void select() { final NodeSelector<String> selector = new SelectorNodeSelector<>( new RootMatcherSelector<>(new AlwaysMatcher<>()), new RootMatcherSelector<>(new AlwaysMatcher<>())); final Iterator<? extends MutableSettableStructuredNode<String>> iterator = selector.select(tree); assertTrue(iterator.hasNext()); assertEquals("b", iterator.next().getElement()); assertEquals("c", iterator.next().getElement()); assertFalse(iterator.hasNext()); }
@Test public void selectNothing() { final NodeSelector<String> selector = new SelectorNodeSelector<>( new RootMatcherSelector<>(new AlwaysMatcher<>()), new RootMatcherSelector<>(new NeverMatcher<>())); final Iterator<? extends MutableSettableStructuredNode<String>> iterator = selector.select(tree); assertFalse(iterator.hasNext()); }