ExecutableWithDescriptor { List<RobotToken> getForVariables() { final ForLoopDeclarationRowDescriptor<?> descriptor = loopExecutable.getDescriptor(); return descriptor.getCreatingVariables().collect(toList()); } ExecutableWithDescriptor(final RobotExecutableRow<?> executable, final IExecutableRowDescriptor<?> descriptor,
            final String template);   ExecutableWithDescriptor(final ForLoop loopExecutable, final String template);   }
@Test public void variablesFromForLoopAreProperlyReturned() { final TestCase holder = new TestCase(RobotToken.create("test")); final RobotExecutableRow<TestCase> executable = new RobotExecutableRow<>(); executable.setParent(holder); holder.addElement(executable); executable.setAction(RobotToken.create(":FOR", RobotTokenType.FOR_TOKEN)); executable.addArgument(RobotToken.create("${x}")); executable.addArgument(RobotToken.create("${y}")); executable.addArgument(RobotToken.create("IN", RobotTokenType.IN_TOKEN)); executable.addArgument(RobotToken.create("@{XS}")); final ForLoopDeclarationRowDescriptor<?> desc = (ForLoopDeclarationRowDescriptor<?>) executable .buildLineDescription(); final ExecutableWithDescriptor loopHeader = new ExecutableWithDescriptor(executable, desc, null); final ExecutableWithDescriptor descriptor = new ExecutableWithDescriptor( new ForLoop(loopHeader, newArrayList()), null); final List<RobotToken> variables = descriptor.getForVariables(); assertThat(variables).hasSize(2); assertThat(variables.get(0).getText()).isEqualTo("${x}"); assertThat(variables.get(1).getText()).isEqualTo("${y}"); }