void () { final String testFile = getTestName(true) + ".test"; final List<String> strings = TestUtils.readInput(getTestDataPath() + "/" + testFile); GroovyFileBase psiFile = (GroovyFileBase) myFixture.addFileToProject("foo.groovy", strings.get(0)); StringBuilder buffer = new StringBuilder(); GrTypeDefinition[] grTypeDefinitions = psiFile.getTypeDefinitions(); GrTypeDefinition lastTypeDefinition = psiFile.getTypeDefinitions()[grTypeDefinitions.length - 1]; PsiMethod[] psiMethods = lastTypeDefinition.getMethods(); for (PsiMethod method : psiMethods) { PsiMethod[] superMethods = findMethod(method); String[] classes = sortUseContainingClass(superMethods); for (String classAsString : classes) { buffer.append(classAsString); buffer.append("\n"); //between different super methods } buffer.append("\n"); //between different methods } buffer.append("\n"); //between class definitions assertEquals(strings.get(1), buffer.toString().trim()); }