List<PsiClassType> (@NotNull PsiMethodReferenceExpression methodReferenceExpression, PsiElement topElement) { final JavaResolveResult resolveResult = methodReferenceExpression.advancedResolve(false); final PsiElement resolve = resolveResult.getElement(); if (resolve instanceof PsiMethod) { final PsiElement referenceNameElement = methodReferenceExpression.getReferenceNameElement(); return getUnhandledExceptions((PsiMethod)resolve, referenceNameElement, topElement, resolveResult::getSubstitutor); } return Collections.emptyList(); }