public static Class<? extends Annotation> findAnnotationClass(Class<?> c, Class<?> base) {
		if (c == Object.class || c == null) return null;
		Class<? extends Annotation> answer = null;
		
		answer = findAnnotationHelper(base, c.getGenericSuperclass());
		if (answer != null) return answer;
		
		for (Type iface : c.getGenericInterfaces()) {
			answer = findAnnotationHelper(base, iface);
			if (answer != null) return answer;
		}
		
		Class<? extends Annotation> potential = findAnnotationClass(c.getSuperclass(), base);
		if (potential != null) return potential;
		for (Class<?> iface : c.getInterfaces()) {
			potential = findAnnotationClass(iface, base);
			if (potential != null) return potential;
		}
		
		return null;
	}
public static Class < ? extends Annotation > findAnnotationClass ( Class < ? > c , Class < ? > base ) { if ( c == Object . class || c == null ) return null ; Class < ? extends Annotation > answer = null ; answer = findAnnotationHelper ( base , c . getGenericSuperclass ( ) ) ; if ( answer != null ) return answer ; for ( Type iface : c . getGenericInterfaces ( ) ) { answer = findAnnotationHelper ( base , iface ) ; if ( answer != null ) return answer ; } Class < ? extends Annotation > potential = findAnnotationClass ( c . getSuperclass ( ) , base ) ; if ( potential != null ) return potential ; for ( Class < ? > iface : c . getInterfaces ( ) ) { potential = findAnnotationClass ( iface , base ) ; if ( potential != null ) return potential ; } return null ; }
This method will find the @{code T} in {@code public class Foo extends BaseType<T>}.

It returns an annotation type because it is used exclusively to figure out which annotations are
being handled by {@link lombok.eclipse.EclipseAnnotationHandler} and {@link lombok.javac.JavacAnnotationHandler}.