void () { myFixture.configureByText("A.groovy", """ def xml = new groovy.xml.MarkupBuilder() xml.records() { foo<caret>() } """); PsiElement method = myFixture.getElementAtCaret(); assert method instanceof GrLightMethodBuilder; assert ((GrLightMethodBuilder)method).getReturnType().getCanonicalText().equals("java.lang.String"); }