void () { for (String text : List.of("builder.root()", "builder.root {}", "builder.root(a: 1, b: 2)", "builder.root(a: 1, b: 2) {}", "builder.root([1, 2, 3, 4]) {}", "builder.root([] as Integer[], {})")) { GroovyFile file = (GroovyFile)getFixture().configureByText("a.groovy", "def builder = new groovy.json.StreamingJsonBuilder(null);" + text); GrTopStatement[] statements = file.getTopStatements(); GrCallExpression call = (GrCallExpression)statements[statements.length - 1]; assert call.resolveMethod() != null; assert call.getType().getCanonicalText().equals("groovy.json.StreamingJsonBuilder"); } }