code: @SuppressWarnings("override")// must be disabled to support jdk 6+
      public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
          if (annotationClass == null) {
              throw new NullPointerException("Cannot get a declared annotation with a 'null' annotationClass.");
          }
  
          return annotationClass.cast(declaredAnnotations.get(annotationClass));
      }
docs: Returns this property's annotation for the specified type if
  such an annotation is <em>collectively and directly present</em>,
  else {@code null}.
  
  <p> This method ignores inherited annotations. and returns {@code null}
  if no annotations are <em>collectively and directly present</em> on
  this property's members.
  
  @param <T>             the type of the annotation to query for and return if
  collectively and directly present
  @param annotationClass the Class corresponding to the annotation type
  @return this property's annotation for the specified annotation type if
  collectively and directly present on this element, else {@code null}
  @throws NullPointerException if the given annotation class is {@code null}