public static <T extends ScanTask> List<ScanTaskGroup<T>> planTaskGroups(
      List<T> tasks, long splitSize, int lookback, long openFileCost) {
    return Lists.newArrayList(
        planTaskGroups(CloseableIterable.withNoopClose(tasks), splitSize, lookback, openFileCost));
  }
@Test
  public void testTaskGroupPlanningCorruptedOffset() {
    DataFile dataFile =
        DataFiles.builder(TestBase.SPEC)
            .withPath("/path/to/data-a.parquet")
            .withFileSizeInBytes(10)
            .withPartitionPath("data_bucket=0")
            .withRecordCount(1)
            .withSplitOffsets(
                ImmutableList.of(2L, 12L)) // the last offset is beyond the end of the file
            .build();

    ResidualEvaluator residualEvaluator =
        ResidualEvaluator.of(TestBase.SPEC, Expressions.equal("id", 1), false);

    BaseFileScanTask baseFileScanTask =
        new BaseFileScanTask(
            dataFile,
            null,
            SchemaParser.toJson(TestBase.SCHEMA),
            PartitionSpecParser.toJson(TestBase.SPEC),
            residualEvaluator);

    List<BaseFileScanTask> baseFileScanTasks = ImmutableList.of(baseFileScanTask);

    int taskCount = 0;
    for (ScanTaskGroup<BaseFileScanTask> task :
        TableScanUtil.planTaskGroups(CloseableIterable.withNoopClose(baseFileScanTasks), 1, 1, 0)) {
      for (FileScanTask fileScanTask : task.tasks()) {
        DataFile taskDataFile = fileScanTask.file();
        assertThat(taskDataFile.splitOffsets()).isNull();
        taskCount++;
      }
    }

    // 10 tasks since the split offsets are ignored and there are 1 byte splits for a 10 byte file
    assertThat(taskCount).isEqualTo(10);
  }