ReflectionLoader { public static Object invokeMethod(Object object, String method, Class<?>[] params, Object... args) throws ReflectionException { try { Method m = object.getClass().getDeclaredMethod(method, params); m.setAccessible(true); return m.invoke(object, args); } catch(NoSuchMethodException e) { log.error("Unable to invoke method, could not be found", e); throw new ReflectionException("Unable to invoke method, could not be found", e); } catch (InvocationTargetException e) { log.error("Unable to invoke target method, exception in method", e); throw new ReflectionException("Unable to invoke target method, exception in method", e); } catch (IllegalAccessException e) { log.error("Unable to invoke method, inaccessible", e); throw new ReflectionException("Unable to invoke method, inaccessible", e); } }  static T loadClass(Class<T> expectedSubtype, String className, Object[] args); static T loadClass(Class<T> expectedSubtype, String className, 
			Class<?>[] constructorArguments, Object[] args); static Object invokeMethod(Object object, String method, Class<?>[] params, Object... args); static Object getField(Object object, String field);  }
@Test public void testLoadPrivateMethod() throws Exception { TestClassWithPrivates tc = new TestClassWithPrivates(); Object result = ReflectionLoader.invokeMethod(tc, "getPrivateMethod", new Class<?>[] {}); Assert.assertNotNull(result); Assert.assertEquals("Expected privateMethodReturn", "privateMethodReturn", result.toString()); }