void () { final List<String> data = TestUtils.readInput(getTestDataPath() + "/" + getTestName(true) + ".test"); String fileText = data.get(0); PsiFile psiFile = TestUtils.createPseudoPhysicalGroovyFile(getProject(), fileText); ASTNode node = psiFile.getNode(); Assert.assertNotNull(node); IElementType type = node.getElementType(); Assert.assertTrue(type instanceof IStubFileElementType); IStubFileElementType stubFileType = (IStubFileElementType) type; StubBuilder builder = stubFileType.getBuilder(); StubElement element = builder.buildStubTree(psiFile); StringBuffer buffer = new StringBuffer(); getStubsTreeImpl(element, buffer, ""); String stubTree = buffer.toString().trim(); assertEquals(data.get(1), stubTree); }