@Test public void testExceptions() throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, InternalSecurityException { TestService testee = new TestService(); try { ServiceHelper.execute(testee, "privateMethod"); fail("ServiceMethodNotFoundException expected"); } catch (ServiceMethodNotFoundException e) { } try { ServiceHelper.execute(testee, "protectedMethod"); fail("ServiceMethodNotFoundException expected"); } catch (ServiceMethodNotFoundException e) { } try { ServiceHelper.execute(testee, "staticMethod"); fail("ServiceMethodNotFoundException expected"); } catch (ServiceMethodNotFoundException e) { } }
public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }  }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }  static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(Class<?> c); static boolean isSubclass(Class<?> subClass, Class<?> superClass); static Class<?> getUnwrappedClass(Class<?> c); static Object execute(Service service, String method); static Object execute(Service service, String method, Object... parameters); static Method searchMethod(Class<? extends Service> serviceClass, String methodName, Object[] params); static String getParameterString(Object[] params); }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }  static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(Class<?> c); static boolean isSubclass(Class<?> subClass, Class<?> superClass); static Class<?> getUnwrappedClass(Class<?> c); static Object execute(Service service, String method); static Object execute(Service service, String method, Object... parameters); static Method searchMethod(Class<? extends Service> serviceClass, String methodName, Object[] params); static String getParameterString(Object[] params);  }