void (Editor editor, PsiElement anchor, PsiExpression expr, Consumer<? super PsiElement> callback) { List<? extends PsiElement> containers = getContainers(anchor, expr); if (containers.size() == 1 ) { callback.accept(anchor); } else { IntroduceTargetChooser.showChooser(editor, containers, Pass.create(callback), element -> { PsiElement container = takeNextContainer(containers, element); if (container instanceof PsiLambdaExpression) { PsiType type = ((PsiLambdaExpression)container).getFunctionalInterfaceType(); return (type != null ? type.getPresentableText() + ": " : "") + PsiExpressionTrimRenderer.render((PsiExpression)container); } return JavaBundle.message("target.code.block.presentable.text"); }, JavaBundle.message("popup.title.select.target.code.block"), element -> { PsiElement result = takeNextContainer(containers, element); return result instanceof PsiLambdaExpression ? Objects.requireNonNull(((PsiLambdaExpression)result).getBody()).getTextRange() : result.getTextRange(); }); } }