public static Optional < Method > getAnnotatedMethod ( Class annotation , Class clazz ) { List < Method > methods = getAnnotatedMethods ( annotation , clazz ) ; return Optional . ofNullable ( methods . size ( ) > 0 ? methods . get ( 0 ) : null ) ; }
Method getAnnotatedMethod the first annotated method of the type of annotation specified .