private static void collectOccurrenceClasses(Set<? super PsiClass> occurrenceClasses, PsiType occurrenceType) {
    if (occurrenceType instanceof PsiIntersectionType) {
      for (PsiType type : ((PsiIntersectionType)occurrenceType).getConjuncts()) {
        collectOccurrenceClasses(occurrenceClasses, type);
      }
    }
    else if (occurrenceType instanceof PsiCapturedWildcardType) {
      collectOccurrenceClasses(occurrenceClasses, ((PsiCapturedWildcardType)occurrenceType).getUpperBound());
    }
    else {
      final PsiClass aClass = PsiUtil.resolveClassInType(occurrenceType);
      if (aClass != null) {
        occurrenceClasses.add(aClass);
      }
    }
  }
private static void collectOccurrenceClasses(Set<? super PsiClass> occurrenceClasses, PsiType occurrenceType)