@Test
  public void serDeBackwardCompatibilityTest() throws IOException {
    CompactionDetails.CURRENT_VERSION = CompactionDetails.VERSION_0;
    int segmentCount = TestUtils.RANDOM.nextInt(10) + 1;
    List<LogSegmentName> segmentsUnderCompaction = new ArrayList<>();
    for (int i = 0; i < segmentCount; i++) {
      LogSegmentName segmentName = StoreTestUtils.getRandomLogSegmentName(segmentsUnderCompaction);
      segmentsUnderCompaction.add(segmentName);
    }
    long referenceTime = SystemTime.getInstance().milliseconds();
    CompactionDetails details = new CompactionDetails(referenceTime, segmentsUnderCompaction, null);
    DataInputStream stream = new DataInputStream(new ByteArrayInputStream(details.toBytes()));

    CompactionDetails.CURRENT_VERSION = CompactionDetails.VERSION_1;
    verifyEquality(details, CompactionDetails.fromBytes(stream));
  }
Tests the serialization and deserialization of {@link CompactionDetails} and verifies eqaulity of the original and
deserialized forms.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/CompactionDetailsTest.java