@SuppressWarnings("unchecked")
	public static <T> T callMethod(String name, Object target, Object[] args, Class<?>[] argsTypes) throws Exception {
		Class<?> clazz = target.getClass();
		Method method = ReflectionUtils.findMethod(clazz, name, argsTypes);

		if (method == null)
			throw new IllegalArgumentException("Cannot find method '" + method + "' in the class hierarchy of "
					+ target.getClass());
		method.setAccessible(true);
		return (T) ReflectionUtils.invokeMethod(method, target, args);
	}
Utils for tests.

@author Janne Valkealahti
extensions/spring-xd-extension-gpfdist/src/test/java/org/springframework/xd/greenplum/TestUtils.java