private static Change doBuildChanges(int @NotNull [] ints1, int @NotNull [] ints2, @NotNull ChangeBuilder builder)
    throws FilesTooBigForDiffException {
    Reindexer reindexer = new Reindexer(); // discard unique elements, that have no chance to be matched
    int[][] discarded = reindexer.discardUnique(ints1, ints2);

    if (discarded[0].length == 0 && discarded[1].length == 0) {
      // assert trimmedLength > 0
      builder.addChange(ints1.length, ints2.length);
      return builder.getFirstChange();
    }

    BitSet[] changes;
    if (DiffConfig.USE_PATIENCE_ALG) {
      PatienceIntLCS patienceIntLCS = new PatienceIntLCS(discarded[0], discarded[1]);
      patienceIntLCS.execute();
      changes = patienceIntLCS.getChanges();
    }
    else {
      try {
        MyersLCS intLCS = new MyersLCS(discarded[0], discarded[1]);
        intLCS.executeWithThreshold();
        changes = intLCS.getChanges();
      }
      catch (FilesTooBigForDiffException e) {
        PatienceIntLCS patienceIntLCS = new PatienceIntLCS(discarded[0], discarded[1]);
        patienceIntLCS.execute(true);
        changes = patienceIntLCS.getChanges();
        LOG.info("Successful fallback to patience diff");
      }
    }

    reindexer.reindex(changes, builder);
    return builder.getFirstChange();
  }
private static Change doBuildChanges(int @NotNull [] ints1, int @NotNull [] ints2, @NotNull ChangeBuilder builder)