@Override
  public MergeAppend appendFile(DataFile file) {
    add(file);
    return this;
  }
@TestTemplate
  public void testDataSpecThrowsExceptionIfDataFilesWithDifferentSpecsAreAdded() {
    assertThat(listManifestFiles()).as("Table should start empty").isEmpty();

    TableMetadata base = readMetadata();
    assertThat(base.currentSnapshot()).as("Should not have a current snapshot").isNull();
    assertThat(base.lastSequenceNumber()).as("Last sequence number should be 0").isEqualTo(0);

    table.updateSpec().addField("id").commit();
    PartitionSpec newSpec = table.spec();

    assertThat(table.specs()).as("Table should have 2 specs").hasSize(2);

    DataFile fileNewSpec =
        DataFiles.builder(newSpec)
            .withPath("/path/to/data-b.parquet")
            .withPartitionPath("data_bucket=0/id=0")
            .withFileSizeInBytes(10)
            .withRecordCount(1)
            .build();

    MergeAppend mergeAppend =
        (MergeAppend) table.newAppend().appendFile(FILE_A).appendFile(fileNewSpec);
    assertThatThrownBy(mergeAppend::dataSpec)
        .isInstanceOf(IllegalStateException.class)
        .hasMessage(
            "Cannot return a single partition spec: data files with different partition specs have been added");
  }