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