public static PsiExpression @Nullable [] getConstantArrayElements(PsiVariable array) {
    PsiExpression initializer = array.getInitializer();
    if (initializer instanceof PsiNewExpression) initializer = ((PsiNewExpression)initializer).getArrayInitializer();
    if (!(initializer instanceof PsiArrayInitializerExpression)) return null;
    PsiExpression[] initializers = ((PsiArrayInitializerExpression)initializer).getInitializers();
    if (array instanceof PsiField && !(array.hasModifierProperty(PsiModifier.PRIVATE) && array.hasModifierProperty(PsiModifier.STATIC))) {
      return null;
    }
    if (!isConstantContent(array)) return null;
    Arrays.asList(initializers).replaceAll(expr -> isIllegalReference(array, expr) ? null : expr);
    return initializers;
  }
public static PsiExpression @Nullable [] getConstantArrayElements(PsiVariable array)