public static UnhandledExceptions ofMethod(@NotNull PsiMethod method) {
    PsiCodeBlock body = method.getBody();
    if (body == null) return EMPTY;
    PsiClass containingClass = method.getContainingClass();
    UnhandledExceptions result = collect(body, method, false);
    if (method.isConstructor() && containingClass != null) {
      // there may be field initializer throwing exception
      // that exception must be caught in the constructor
      PsiField[] fields = containingClass.getFields();
      for (final PsiField field : fields) {
        if (field.hasModifierProperty(PsiModifier.STATIC)) continue;
        PsiExpression initializer = field.getInitializer();
        if (initializer == null) continue;
        result = result.merge(collect(initializer, field, true));
      }
    }
    return result;
  }
public static UnhandledExceptions ofMethod(@NotNull PsiMethod method)