Source:
<code>public void testGetValueAtDetailNode() { final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); Assert.assertNotNull("Comment node cannot be null", commentContentNode); final int nodeType = commentContentNode.getType(); Assert.assertTrue("Comment node should be a comment type", TokenUtils.isCommentType(nodeType)); Assert.assertEquals("This should be a javadoc comment", "/*", commentContentNode.getParent().getText()); final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); final Object child = parseTree.getChild(commentContentNode, 0); Assert.assertFalse(parseTree.isLeaf(child)); Assert.assertTrue(parseTree.isLeaf(tree.getFirstChild())); final Object treeModel = parseTree.getValueAt(child, 0); final String type = (String) parseTree.getValueAt(child, 1); final int line = (int) parseTree.getValueAt(child, 2); final int column = (int) parseTree.getValueAt(child, 3); final String text = (String) parseTree.getValueAt(child, 4); final String expectedText = String.join("", System.lineSeparator(), "* class javadoc", System.lineSeparator(), "<EOF>"); Assert.assertEquals(null, treeModel); Assert.assertEquals("JAVADOC", type); Assert.assertEquals(1, line); Assert.assertEquals(0, column); Assert.assertEquals(expectedText, text); try { <START> parseTree.getValueAt(child, 6); <END> Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } }</code><technical_language>Other getValueAt parseTree.getColumnCount() this instead of 6</technical_language>

Target:
public void testGetValueAtDetailNode() { final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); Assert.assertNotNull("Comment node cannot be null", commentContentNode); final int nodeType = commentContentNode.getType(); Assert.assertTrue("Comment node should be a comment type", TokenUtils.isCommentType(nodeType)); Assert.assertEquals("This should be a javadoc comment", "/*", commentContentNode.getParent().getText()); final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); final Object child = parseTree.getChild(commentContentNode, 0); Assert.assertFalse(parseTree.isLeaf(child)); Assert.assertTrue(parseTree.isLeaf(tree.getFirstChild())); final Object treeModel = parseTree.getValueAt(child, 0); final String type = (String) parseTree.getValueAt(child, 1); final int line = (int) parseTree.getValueAt(child, 2); final int column = (int) parseTree.getValueAt(child, 3); final String text = (String) parseTree.getValueAt(child, 4); final String expectedText = String.join("", System.lineSeparator(), "* class javadoc", System.lineSeparator(), "<EOF>"); Assert.assertEquals(null, treeModel); Assert.assertEquals("JAVADOC", type); Assert.assertEquals(1, line); Assert.assertEquals(0, column); Assert.assertEquals(expectedText, text); try { parseTree.getValueAt(child, parseTree.getColumnCount()); Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } }