@Override
  public Template setupTemplateImpl(PsiField field,
                                    Object expectedTypes,
                                    PsiClass targetClass,
                                    Editor editor,
                                    PsiElement context,
                                    boolean createConstantField,
                                    boolean isScrollToTemplate,
                                    @NotNull PsiSubstitutor substitutor) {
    Project project = field.getProject();
    PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);

    field = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(field);
    TemplateBuilderImpl builder = new TemplateBuilderImpl(field);
    builder.setScrollToTemplate(isScrollToTemplate);
    if (!(expectedTypes instanceof ExpectedTypeInfo[])) {
      expectedTypes = ExpectedTypeInfo.EMPTY_ARRAY;
    }
    new GuessTypeParameters(project, factory, builder, substitutor).setupTypeElement(
      field.getTypeElement(), (ExpectedTypeInfo[])expectedTypes, context, targetClass
    );

    if (createConstantField && !field.hasInitializer()) {
      field.setInitializer(factory.createExpressionFromText("0", null));
      builder.replaceElement(field.getInitializer(), new EmptyExpression());
      PsiIdentifier identifier = field.getNameIdentifier();
      builder.setEndVariableAfter(identifier);
    }

    field = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(field);

    editor.getCaretModel().moveToOffset(field.getTextRange().getStartOffset());
    Template template = builder.buildInlineTemplate();
    if (disableShortenLongNames(project, ((ExpectedTypeInfo[])expectedTypes))) {
      template.setToShortenLongNames(false);
    }
    return template;
  }
@Override
  public Template setupTemplateImpl(PsiField field,
                                    Object expectedTypes,
                                    PsiClass targetClass,
                                    Editor editor,
                                    PsiElement context,
                                    boolean createConstantField,
                                    boolean isScrollToTemplate,
                                    @NotNull PsiSubstitutor substitutor)