### Question:
TraversalState { public N nextChild() { return children.next(); } @SuppressWarnings("unchecked")  TraversalState(N node); N getNode(); boolean hasNextChild(); N nextChild();  }### Answer:
@Test public void nextChild() { final TraversalState<String, Node<String>> state = new TraversalState<>(node); state.nextChild(); verify(children).next(); }
@Test public void nextStructuralChild() { final TraversalState<String, MutableSettableStructuredNode<String>> state = new TraversalState<>(structuralNode); state.nextChild(); verify(structuralChildren).next(); }