}
public Object exec(@DelegatesTo(value = CommandDelegate.class, strategy = Closure.DELEGATE_FIRST) Closure<?>... commands) throws IOException {
List<ClosureCommand> closureCommands = new LinkedList<>();
for (Closure<?> command : commands) {
ClosureCommand closureCommand = generator.generate(new RawClosureCommand(command, Collections.<Closure<?>>emptyList()));
closureCommands.add(closureCommand);
}
return support.send(CommandChain.of(ClosureCommand.class, closureCommands));
}