@Override
  public ManageSnapshots createBranch(String name) {
    Snapshot currentSnapshot = transaction.currentMetadata().currentSnapshot();
    if (currentSnapshot != null) {
      return createBranch(name, currentSnapshot.snapshotId());
    }

    SnapshotRef existingRef = transaction.currentMetadata().ref(name);
    Preconditions.checkArgument(existingRef == null, "Ref %s already exists", name);
    // Create an empty snapshot for the branch
    transaction.newFastAppend().toBranch(name).commit();
    return this;
  }
@TestTemplate
  public void testCreateBranch() {
    table.newAppend().appendFile(FILE_A).commit();
    long snapshotId = table.currentSnapshot().snapshotId();
    // Test a basic case of creating a branch
    table.manageSnapshots().createBranch("branch1", snapshotId).commit();
    SnapshotRef expectedBranch = table.ops().refresh().ref("branch1");
    assertThat(expectedBranch).isNotNull().isEqualTo(SnapshotRef.branchBuilder(snapshotId).build());
  }