TextNode extends Node { public boolean isBlank() { return StringUtil.isBlank(getWholeText()); } TextNode(String text, String baseUri); String nodeName(); String text(); TextNode text(String text); String getWholeText(); boolean isBlank(); TextNode splitText(int offset); @Override String toString(); static TextNode createFromEncoded(String encodedText, String baseUri); @Override String attr(String attributeKey); @Override Attributes attributes(); @Override Node attr(String attributeKey, String attributeValue); @Override boolean hasAttr(String attributeKey); @Override Node removeAttr(String attributeKey); @Override String absUrl(String attributeKey);  }
@Test public void testBlank() { TextNode one = new TextNode("", ""); TextNode two = new TextNode(" ", ""); TextNode three = new TextNode(" \n\n ", ""); TextNode four = new TextNode("Hello", ""); TextNode five = new TextNode(" \nHello ", ""); assertTrue(one.isBlank()); assertTrue(two.isBlank()); assertTrue(three.isBlank()); assertFalse(four.isBlank()); assertFalse(five.isBlank()); }