@SuppressWarnings("unchecked")
  default <T extends SemElement, V extends PsiElement> void registerSemElementProvider(SemKey<T> key,
                                                                                       ElementPattern<? extends V> place,
                                                                                       Function<? super V, ? extends @Nullable T> provider) {
    registerSemProvider(key, (element, context) -> {
      if (place.accepts(element, context)) {
        return Collections.singleton(provider.apply((V)element));
      }
      return emptyList();
    });
  }
@SuppressWarnings("unchecked")
  default <T extends SemElement, V extends PsiElement> void registerSemElementProvider(SemKey<T> key,
                                                                                       ElementPattern<? extends V> place,
                                                                                       Function<? super V, ? extends @Nullable T> provider)