public static DslPointcut<GroovyClassDescriptor, GdslType> currentType(final Object arg) {
    final DslPointcut<GdslType,?> inner;
    if (arg instanceof String) {
      inner = subType(arg);
    } else {
      inner = (DslPointcut<GdslType, ?>)arg;
      assert inner.operatesOn(GdslType.class) : "The argument to currentType should be a pointcut working with types, e.g. subType";
    }

    return new DslPointcut<>() {

      @Override
      List<GdslType> matches(GroovyClassDescriptor src, ProcessingContext context) {
        final GdslType currentType = new GdslType(src.getPsiType());
        if (inner.matches(currentType, context) != null) {
          return Collections.singletonList(currentType);
        }
        return null;
      }

      @Override
      boolean operatesOn(Class c) {
        return GroovyClassDescriptor.class == c;
      }
    };
  }
public static DslPointcut<GroovyClassDescriptor, GdslType> currentType(final Object arg)