public Object invoke(ExecuteMethod exec, Object self, Method method, Object... args) {
RemoteWebDriver driver = (RemoteWebDriver) self;
WebDriverLikeCommandExecutor executor = new WebDriverLikeCommandExecutor(driver);
if ("setConfiguration".equals(method.getName())) {
WebDriverLikeCommand command = (WebDriverLikeCommand) args[0];
String key = (String) args[1];
Object value = args[2];
RemoteIOSDriver.setConfiguration(executor, command, key, value);
return null;
} else if ("getConfiguration".equals(method.getName())) {
WebDriverLikeCommand command = (WebDriverLikeCommand) args[0];
return RemoteIOSDriver.getConfiguration(executor, command);
} else {
throw new WebDriverException(method.getName() + " isn't recognized for Configurable");
}
}