boolean (@Nullable PsiExpression expression, @Nullable Object defaultValue) { PsiExpression arrInitExpr = PsiUtil.skipParenthesizedExprDown(expression); PsiNewExpression newExpression = tryCast(arrInitExpr, PsiNewExpression.class); PsiArrayInitializerExpression initializer; if (newExpression == null) { initializer = tryCast(arrInitExpr, PsiArrayInitializerExpression.class); if (initializer == null) return false; } else { initializer = newExpression.getArrayInitializer(); } if (initializer == null) return true; return ContainerUtil.and(initializer.getInitializers(), init -> isDefaultValue(init, defaultValue, init.getType())); }