static <T extends PsiElement> T getPsi(@NotNull Class<T> clazz, PsiElement element, @NotNull Logger log) {
    if (!clazz.isInstance(element)) {
      log.error("unexpected psi class. expected: " + clazz + " got: " + (element == null ? null : element.getClass()));
    }
    //noinspection unchecked
    return (T)element;
  }
static <T extends PsiElement> T getPsi(@NotNull Class<T> clazz, PsiElement element, @NotNull Logger log)