Refactored use of AnnotatedElement.isAnnotationPresent() to getAnnotation() to enable Java 8 support