@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element) {
    PsiLocalVariable variable =
      PsiTreeUtil.getParentOfType(element, PsiLocalVariable.class, false, PsiStatement.class, PsiLambdaExpression.class);
    if (variable == null) {
      return null;
    }
    PsiExpression initializer = variable.getInitializer();
    if (initializer == null) return null;
    PsiDeclarationStatement declaration = tryCast(variable.getParent(), PsiDeclarationStatement.class);
    if (declaration == null || declaration.getDeclaredElements().length != 1) return null;
    PsiCodeBlock block = tryCast(declaration.getParent(), PsiCodeBlock.class);
    if (block == null || ArrayUtil.getFirstElement(block.getStatements()) != declaration) return null;
    PsiLambdaExpression lambda = tryCast(block.getParent(), PsiLambdaExpression.class);
    ChainCallExtractor extractor = ChainCallExtractor.findExtractor(lambda, initializer, variable.getType());
    if (extractor == null) return null;
    PsiParameter parameter = lambda.getParameterList().getParameters()[0];
    if (ContainerUtil.and(VariableAccessUtils.getVariableReferences(parameter), 
                          ref -> PsiTreeUtil.isAncestor(initializer, ref, false))) {
      return Presentation.of(JavaBundle.message("intention.extract.map.step.text", variable.getName(),
                                                extractor.getMethodName(parameter, initializer, variable.getType())));
    }
    return null;
  }
@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element)