### Question:
NodeWalker { public void skipChildren() { int childLen = (currentChildren != null) ? currentChildren.getLength() : 0; for (int i = 0; i < childLen; i++) { Node child = nodes.peek(); if (child.equals(currentChildren.item(i))) { nodes.pop(); } } } NodeWalker(Node rootNode); Node nextNode(); void skipChildren(); Node getCurrentNode(); boolean hasNext();  }### Answer:
@Test public void testSkipChildren() { DOMParser parser = new DOMParser(); try { parser.setFeature("http: parser.setFeature( "http: false); parser .parse(new InputSource(new ByteArrayInputStream(WEBPAGE.getBytes()))); } catch (Exception e) { e.printStackTrace(); } StringBuffer sb = new StringBuffer(); NodeWalker walker = new NodeWalker(parser.getDocument()); while (walker.hasNext()) { Node currentNode = walker.nextNode(); short nodeType = currentNode.getNodeType(); if (nodeType == Node.TEXT_NODE) { String text = currentNode.getNodeValue(); text = text.replaceAll("\\s+", " "); sb.append(text); } } assertTrue("UL Content can NOT be found in the node", findSomeUlContent(sb.toString())); StringBuffer sbSkip = new StringBuffer(); NodeWalker walkerSkip = new NodeWalker(parser.getDocument()); while (walkerSkip.hasNext()) { Node currentNode = walkerSkip.nextNode(); String nodeName = currentNode.getNodeName(); short nodeType = currentNode.getNodeType(); if ("ul".equalsIgnoreCase(nodeName)) { walkerSkip.skipChildren(); } if (nodeType == Node.TEXT_NODE) { String text = currentNode.getNodeValue(); text = text.replaceAll("\\s+", " "); sbSkip.append(text); } } assertFalse("UL Content can be found in the node", findSomeUlContent(sbSkip.toString())); }