@Contract("null, _, _ -> null")
  public static PsiExpression convertInitializerToExpression(@Nullable PsiExpression initializer,
                                                             @NotNull PsiElementFactory factory,
                                                             @Nullable PsiType type) {
    if (initializer instanceof PsiArrayInitializerExpression && type instanceof PsiArrayType) {
      PsiNewExpression result =
        (PsiNewExpression)factory.createExpressionFromText("new " + type.getCanonicalText() + "{}", null);
      Objects.requireNonNull(result.getArrayInitializer()).replace(initializer);
      return result;
    }
    return initializer;
  }
@Contract("null, _, _ -> null")
  public static PsiExpression convertInitializerToExpression(@Nullable PsiExpression initializer,
                                                             @NotNull PsiElementFactory factory,
                                                             @Nullable PsiType type)