fun <T : Annotation?> checkAnnotationPresent( annotatedType: AnnotatedElement?, annotationClass: Class<T>? ): T { return getAnnotation(annotatedType, annotationClass) }
Check if the annotation is present and if not throws an exception , this is just an overload for more clear naming .