@Override
  public void execute(ComputationStep.Context context) {
    DuplicationVisitor visitor = new DuplicationVisitor();
    new DepthTraversalTypeAwareCrawler(visitor).visit(treeRootHolder.getReportTreeRoot());
    context.getStatistics().add("duplications", visitor.count);
  }
@Test
  public void loads_never_consider_originals_from_batch_on_same_lines_as_the_equals() {
    reportReader.putDuplications(
      FILE_2_REF,
      createDuplication(
        singleLineTextRange(LINE),
        createInnerDuplicate(LINE + 1), createInnerDuplicate(LINE + 2), createInProjectDuplicate(FILE_1_REF, LINE + 2)),
      createDuplication(
        singleLineTextRange(LINE),
        createInnerDuplicate(LINE + 2), createInnerDuplicate(LINE + 3), createInProjectDuplicate(FILE_1_REF, LINE + 2)));

    TestComputationStepContext context = new TestComputationStepContext();
    underTest.execute(context);

    Component file1Component = treeRootHolder.getComponentByRef(FILE_1_REF);
    assertThat(duplicationRepository.getDuplications(FILE_2_REF)).containsOnly(
      duplication(
        singleLineDetailedTextBlock(1, LINE),
        new InnerDuplicate(singleLineTextBlock(LINE + 1)), new InnerDuplicate(singleLineTextBlock(LINE + 2)),
        new InProjectDuplicate(file1Component, singleLineTextBlock(LINE + 2))),
      duplication(
        singleLineDetailedTextBlock(2, LINE),
        new InnerDuplicate(singleLineTextBlock(LINE + 2)), new InnerDuplicate(singleLineTextBlock(LINE + 3)),
        new InProjectDuplicate(file1Component, singleLineTextBlock(LINE + 2))));

    assertNbOfDuplications(context, 2);
  }