Find why this helper cannot reliably invoke methods selected by name.
Java
import java.lang.reflect.Method;
public class Main {
static Object call(Object target, String name, Object argument)
throws Exception {
Method method = target.getClass().getDeclaredMethod(
name, argument.getClass());
method.setAccessible(true);
return method.invoke(target, argument);
}
}