GrStatement (@Nullable final GrCodeBlock block, @NotNull Collection<PsiElement> replaced) { if (block == null) return null; final List<PsiElement> elements = ContainerUtil.findAll(replaced, element -> PsiTreeUtil.isAncestor(block, element, true)); if (elements.isEmpty()) return null; return (GrStatement)GrIntroduceHandlerBase.findAnchor(elements.toArray(PsiElement.EMPTY_ARRAY), block); }