private static PsiElement @Nullable [] getDefs(@NotNull PsiCodeBlock block,
                                                     @NotNull PsiVariable arrayVar,
                                                     @NotNull PsiReferenceExpression arrayRef,
                                                     @Nullable Object defaultValue) {
        PsiElement[] defs = DefUseUtil.getDefs(block, arrayVar, arrayRef);
        PsiExpression[] expressions = new PsiExpression[defs.length];
        for (int i = 0; i < defs.length; i++) {
          PsiElement def = defs[i];
          PsiVariable variable = tryCast(def, PsiVariable.class);
          if (variable != null) {
            PsiExpression initializer = variable.getInitializer();
            if (!isNewArrayCreation(initializer, defaultValue)) return null;
            expressions[i] = initializer;
            continue;
          }
          PsiAssignmentExpression assignment = PsiTreeUtil.getParentOfType(def, PsiAssignmentExpression.class);
          if (assignment != null) {
            if (!isNewArrayCreation(assignment.getRExpression(), defaultValue)) return null;
            expressions[i] = assignment;
            continue;
          }
          return null;
        }
        return expressions;
      }
private static PsiElement @Nullable [] getDefs(@NotNull PsiCodeBlock block,
                                                     @NotNull PsiVariable arrayVar,
                                                     @NotNull PsiReferenceExpression arrayRef,
                                                     @Nullable Object defaultValue)