code: public static <T extends Annotation> T getAnnotation(final Class<?> componentClass,
  		final Class<T> annotationClass)
  	{
  		T annotation = componentClass.getAnnotation(annotationClass);
  		if (annotation != null)
  		{
  			return annotation;
  		}
  		for (final Class<?> ifc : componentClass.getInterfaces())
  		{
  			annotation = getAnnotation(ifc, annotationClass);
  			if (annotation != null)
  			{
  				return annotation;
  			}
  		}
  		if (!Annotation.class.isAssignableFrom(componentClass))
  		{
  			for (final Annotation ann : componentClass.getAnnotations())
  			{
  				annotation = getAnnotation(ann.annotationType(), annotationClass);
  				if (annotation != null)
  				{
  					return annotation;
  				}
  			}
  		}
  		final Class<?> superClass = componentClass.getSuperclass();
  		if (superClass == null || superClass.equals(Object.class))
  		{
  			return null;
  		}
  		return getAnnotation(superClass, annotationClass);
  	}
docs: Search for the given annotationClass in the given componentClass and return it if search was
  successful.
  
  @param <T>
  the generic type
  @param componentClass
  the component class
  @param annotationClass
  the annotation class
  @return the annotation