public static ContextFilter fromClassPattern(ElementPattern pattern) {
    return (descriptor, ctx) -> {
      PsiType type = descriptor.getPsiType();
      return type instanceof PsiClassType && pattern.accepts(((PsiClassType)type).resolve());
    };
  }
public static ContextFilter fromClassPattern(ElementPattern pattern)