public static void assertOnlyOneMethod ( final Collection < Method > methods , Class < ? extends Annotation > annotation ) { if ( methods . size ( ) > 1 ) { throw annotation == null ? MESSAGES . onlyOneMethodCanExist ( ) : MESSAGES . onlyOneMethodCanExist2 ( annotation ) ; } }
Asserts only one method is annotated with annotation .