private static Object invoke ( Method method , Object obj , Object ... args ) { try { return method . invoke ( obj , args ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( "Can't invoke method " + method . getName ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new IllegalArgumentException ( "Can't invoke method " + method . getName ( ) , e ) ; } }
Invokes a method and rethrows any exception as runtime exceptions .