public static String toJson(SnapshotRef ref) {
    return toJson(ref, false);
  }
@Test
  public void testBranchToJsonAllFields() {
    String json =
        "{\"snapshot-id\":1,\"type\":\"branch\",\"min-snapshots-to-keep\":2,"
            + "\"max-snapshot-age-ms\":3,\"max-ref-age-ms\":4}";
    SnapshotRef ref =
        SnapshotRef.branchBuilder(1L)
            .minSnapshotsToKeep(2)
            .maxSnapshotAgeMs(3L)
            .maxRefAgeMs(4L)
            .build();
    assertThat(SnapshotRefParser.toJson(ref))
        .as("Should be able to serialize branch with all fields")
        .isEqualTo(json);
  }