ic boolean cover(@NotNull PsiElement context, @NotNull PsiType whoType, @NotNull PsiType overWhom) {
    List<PsiType> whoTypes = getAllTypes(whoType);
    List<PsiType> overWhomTypes = getAllTypes(overWhom);
    for (PsiType currentWhoType : whoTypes) {
      if (!ContainerUtil.exists(overWhomTypes, currentOverWhomType -> {
        boolean unconditionallyExactForType =
          JavaPsiPatternUtil.isUnconditionallyExactForType(context, currentOverWhomType, currentWhoType);
        if (unconditionallyExactForType) return true;
        PsiPrimitiveType unboxedOverWhomType = PsiPrimitiveType.getUnboxedType(currentOverWhomType);
        if (unboxedOverWhomType == null) return false;
        return JavaPsiPatternUtil.isUnconditionallyExactForType(context, unboxedOverWhomType, currentWhoType);
      })) {
        return false;
      }
    }
    return true;
  }

  
ic boolean cover(@NotNull PsiElement context, @NotNull PsiType whoType, @NotNull PsiType overWhom) {
 