  @Test
  public void testGraphOneLoopOnce() {

    Set<Step> steps = Sets.newHashSet();

    Map<String, Object> loopStepConfigMap = Maps.newHashMap();
    loopStepConfigMap.put(LoopStep.MODE_PROPERTY, LoopStep.MODE_PARALLEL);
    loopStepConfigMap.put(LoopStep.SOURCE_PROPERTY, LoopStep.SOURCE_RANGE);
    loopStepConfigMap.put(LoopStep.RANGE_START_PROPERTY, 5);
    loopStepConfigMap.put(LoopStep.RANGE_END_PROPERTY, 5);
    Config loopStepConfig = ConfigFactory.parseMap(loopStepConfigMap);
    RefactorStep loopStep = new LoopStep("loop_step");
    loopStep.configure(loopStepConfig);
    steps.add(loopStep);

    Map<String, Object> step1ConfigMap = Maps.newHashMap();
    step1ConfigMap.put(Step.DEPENDENCIES_CONFIG, Lists.newArrayList("loop_step"));
    Config step1Config = ConfigFactory.parseMap(step1ConfigMap);
    Step step1 = new BatchStep("step1");
    step1.configure(step1Config);
    steps.add(step1);

    Set<Step> unrolled = loopStep.refactor(steps);

    assertEquals(unrolled.size(), 2);

    assertEquals(StepUtils.getStepForName("loop_step", unrolled).get().getDependencyNames(), Sets.newHashSet());
    assertEquals(StepUtils.getStepForName("step1_5", unrolled).get().getDependencyNames(), Sets.newHashSet("loop_step"));
  }