public Method [ ] findMethods ( Pattern methodNamePattern ) { final Method [ ] allMethods = this . targetClass . getMethods ( ) ; final List < Method > result = new ArrayList < Method > ( ) ; for ( int i = 0 ; i < allMethods . length ; i ++ ) { final Method m = allMethods [ i ] ; if ( methodNamePattern . matcher ( m . getName ( ) ) . matches ( ) ) { result . add ( m ) ; } } return result . toArray ( new Method [ result . size ( ) ] ) ; }
Find the methods on the target class that matches the supplied method name .