class SofaTracerIntroductionInterceptor implements IntroductionInterceptor {

    private final MethodInvocationProcessor sofaMethodInvocationProcessor;

    public SofaTracerIntroductionInterceptor(MethodInvocationProcessor sofaMethodInvocationProcessor) {
        this.sofaMethodInvocationProcessor = sofaMethodInvocationProcessor;
    }

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Method method = invocation.getMethod();
        Method mostSpecificMethod = AopUtils.getMostSpecificMethod(method, invocation.getThis()
            .getClass());

        Tracer tracerSpan = findAnnotation(mostSpecificMethod, Tracer.class);
        if (tracerSpan == null) {
            return invocation.proceed();
        }
        return sofaMethodInvocationProcessor.process(invocation, tracerSpan);
    }

    @Override
    public boolean implementsInterface(Class<?> aClass) {
        return true;
    }

    private <T extends Annotation> T findAnnotation(Method method, Class<T> clazz) {<FILL_FUNCTION_BODY>}
}

        T annotation = AnnotationUtils.findAnnotation(method, clazz);
        if (annotation == null) {
            try {
                annotation = AnnotationUtils.findAnnotation(
                    method.getDeclaringClass().getMethod(method.getName(),
                        method.getParameterTypes()), clazz);
            } catch (NoSuchMethodException | SecurityException ex) {
                SelfLog.warn("Exception occurred while tyring to find the annotation");
            }
        }
        return annotation;
    
<no_super_class>