code: public static <T extends Annotation> Optional<T> getAnnotation( Class<T> annotation, List<? extends HasAnnotations>
              hasAnnotationsList ) {
          for ( HasAnnotations accessor : hasAnnotationsList ) {
              if ( accessor.isAnnotationPresent( annotation ) ) {
                  return Optional.of( accessor.getAnnotation( annotation ) );
              }
          }
          return Optional.absent();
      }
docs: Returns the first occurence of the annotation found on the types
  
  @param annotation the annotation
  @param hasAnnotationsList the types
  @return the first occurence of the annotation found on the types
  @param <T> a T object.