### Question:
MethodInvoker { public Object invoke(Method method, Object target, Object[] javaArgs) throws Throwable { try { if (method.isAnnotationPresent(Pending.class)) { throw exceptionFactory.cucumberPending(method.getAnnotation(Pending.class).value()); } else { return method.invoke(target, javaArgs); } } catch (IllegalArgumentException e) { String m = "Couldn't invokeWithArgs " + method.toGenericString() + " with " + cuke4duke.internal.Utils.join(javaArgs, ","); throw exceptionFactory.cucumberArityMismatchError(m); } catch (InvocationTargetException e) { throw e.getTargetException(); } } MethodInvoker(ExceptionFactory exceptionFactory); Object invoke(Method method, Object target, Object[] javaArgs);  }### Answer:
@Test(expected = org.jruby.exceptions.RaiseException.class) public void shouldRaiseCucumberPendingWhenAnnotatedWithPending() throws Throwable { Method dontExecuteMe = SomethingWithPending.class.getDeclaredMethod("dontExecuteMe"); MethodInvoker mi = new MethodInvoker(new JRubyExceptionFactory()); mi.invoke(dontExecuteMe, new SomethingWithPending(), new Object[0]); }