@Contract("_, null, _ -> null")
  public static @Nullable DfaValue getArrayElementValue(@NotNull DfaValueFactory factory, @Nullable DfaValue array, int index) {
    if (!(array instanceof DfaVariableValue arrayDfaVar) || index < 0) return null;
    DfType componentType = TypeConstraint.fromDfType(arrayDfaVar.getDfType()).getArrayComponentType();
    if (componentType == DfType.BOTTOM) return null;
    PsiVariable arrayPsiVar = ObjectUtils.tryCast(arrayDfaVar.getPsiVariable(), PsiVariable.class);
    if (arrayPsiVar != null) {
      PsiExpression constantArrayElement = ExpressionUtils.getConstantArrayElement(arrayPsiVar, index);
      if (constantArrayElement != null) {
        PsiType elementType = constantArrayElement.getType();
        if (componentType instanceof DfReferenceType && elementType instanceof PsiPrimitiveType &&
            !TypeConstraint.fromDfType(componentType).isPrimitiveWrapper()) {
          componentType = DfTypes.typedObject(((PsiPrimitiveType)elementType).getBoxedType(constantArrayElement), Nullability.UNKNOWN)
            .meet(componentType);
        }
        return getAdvancedExpressionDfaValue(factory, constantArrayElement, componentType);
      }
    }
    return new ArrayElementDescriptor(index).createValue(factory, arrayDfaVar);
  }
@Contract("_, null, _ -> null")
  public static @Nullable DfaValue getArrayElementValue(@NotNull DfaValueFactory factory, @Nullable DfaValue array, int index)