public static Root @Nullable [] getSearchRoots(final PsiElement element) {
    if (element instanceof PsiThrowStatement aThrow) {
      final PsiExpression exn = aThrow.getException();
      PsiType exType = exn == null ? null : exn.getType();
      if (exType == null) return null;

      return new Root[]{new Root(aThrow.getParent(), exType, isExactExnType(exn))};
    }
    if (element instanceof PsiKeyword kwd && PsiKeyword.THROWS.equals(kwd.getText())) {
      final PsiElement parent = kwd.getParent();
      if (parent != null && parent.getParent() instanceof PsiMethod method) {
        final PsiReferenceList throwsList = method.getThrowsList();
        final PsiClassType[] exns = throwsList.getReferencedTypes();
        final Root[] roots = new Root[exns.length];
        for (int i = 0; i != roots.length; ++i) {
          final PsiClassType exn = exns[i];
          roots[i] = new Root(method, exn, false); // TODO: test for final
        }
        return roots;
      }
    }
    return null;
  }
public static Root @Nullable [] getSearchRoots(final PsiElement element)