void (@NotNull GrVariable field, @NotNull GrAnonymousClassDefinition scope, @NotNull Collection<PsiElement> replaced) { final GrClassInitializer[] initializers = scope.getInitializers(); GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(myContext.getProject()); final GrClassInitializer initializer = initializers.length == 0 ? (GrClassInitializer)scope.add(factory.createClassInitializer()) : initializers[0]; final GrStatement anchor = findAnchorForAssignment(initializer.getBlock(), replaced); initializeInMethodInner(field, initializer.getBlock(), anchor, ContainerUtil.getFirstItem(replaced)); }