void () { myBuilder = createBuilder("package"); final PsiBuilder.Marker fileMarker = myBuilder.mark(); assertEquals("package", myBuilder.getTokenText()); assertEquals(JavaTokenType.PACKAGE_KEYWORD, myBuilder.getTokenType()); final PsiBuilder.Marker packageStatementMarker = myBuilder.mark(); myBuilder.advanceLexer(); assertTrue(myBuilder.eof()); packageStatementMarker.drop(); fileMarker.done(JavaParserDefinition.JAVA_FILE); ASTNode fileNode = myBuilder.getTreeBuilt(); assertNotNull(fileNode); assertEquals("package", fileNode.getText()); assertSame(fileNode.getFirstChildNode(), fileNode.getLastChildNode()); ASTNode leaf = fileNode.getFirstChildNode(); assertNotNull(leaf); assertEquals(JavaTokenType.PACKAGE_KEYWORD, leaf.getElementType()); assertEquals("package", leaf.getText()); assertNull(leaf.getFirstChildNode()); }