@NotNull
  private static List<PsiType> flattenAndGenerify(@NotNull PsiExpression expr, PsiType psiType) {
    if (psiType instanceof PsiIntersectionType intersection) {
      return ContainerUtil.mapNotNull(intersection.getConjuncts(), type -> DfaPsiUtil.tryGenerify(expr, type));
    }
    else if (psiType != null) {
      return Collections.singletonList(DfaPsiUtil.tryGenerify(expr, psiType));
    }
    else {
      return Collections.emptyList();
    }
  }
@NotNull
  private static List<PsiType> flattenAndGenerify(@NotNull PsiExpression expr, PsiType psiType)