private static void inlineRedundant(@Nullable PsiElement declaration) {
      if (declaration == null) return;
      final PsiLocalVariable newVariable = extractDeclared(declaration);
      if (newVariable != null) {
        final PsiExpression initializer = PsiUtil.skipParenthesizedExprDown(newVariable.getInitializer());
        if (VariableAccessUtils.isLocalVariableCopy(newVariable, initializer)) {
          Collection<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(newVariable);
          IntentionPreviewUtils.write(() -> {
            for (PsiReferenceExpression reference : references) {
              CommonJavaInlineUtil.getInstance().inlineVariable(newVariable, initializer, reference, null);
            }
            declaration.delete();
          });
        }
      }
    }
private static void inlineRedundant(@Nullable PsiElement declaration)