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.done(JavaElementType.PACKAGE_STATEMENT); fileMarker.done(JavaParserDefinition.JAVA_FILE); ASTNode fileNode = myBuilder.getTreeBuilt(); assertNotNull(fileNode); assertEquals("package", fileNode.getText()); assertSame(fileNode.getFirstChildNode(), fileNode.getLastChildNode()); ASTNode packageNode = fileNode.getFirstChildNode(); assertNotNull(packageNode); assertEquals("package", packageNode.getText()); assertEquals(JavaElementType.PACKAGE_STATEMENT, packageNode.getElementType()); ASTNode leaf = packageNode.getFirstChildNode(); assertNotNull(leaf); assertEquals(JavaTokenType.PACKAGE_KEYWORD, leaf.getElementType()); }