NodeIterator { public boolean nextIsText() { if (next == null) { return false; } return next instanceof Text; } NodeIterator(List<? extends Node> nodes, boolean ignoreWhitespaceText); boolean hasNext(); boolean nextIsText(); boolean nextIsElement(); boolean nextIsXliffElement(); boolean nextIsXliffElement(String localName); boolean nextIsNonXliffElement(); String getText(); Element getElement(); Element getXliffElement(); Element getNonXliffElement(); Element getXliffElement(String localName); void assertNoMoreNodes(); Element getXliffElement(String... localNames);  }
@Test public void testNextIsText() throws ConstraintViolationException { NodeIterator ni; ArrayList<Node> nodes = new ArrayList<Node>(); Document doc = Utils.createDocument(); ni = new NodeIterator(nodes, false); assertFalse(ni.nextIsText()); nodes.add(doc.createTextNode("abc")); nodes.add(doc.createElementNS("ns", "name")); ni = new NodeIterator(nodes, false); assertTrue(ni.nextIsText()); ni.getText(); assertFalse(ni.nextIsText()); }