@Test
  public void serDeTest() throws IOException {
    for (short version : new short[]{CompactionDetails.VERSION_0, CompactionDetails.VERSION_1}) {
      CompactionDetails.CURRENT_VERSION = version;
      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();
      for (boolean isFullRange : new boolean[]{false, true}) {
        CompactionDetails details = new CompactionDetails(referenceTime, segmentsUnderCompaction, null, isFullRange);
        DataInputStream stream = new DataInputStream(new ByteArrayInputStream(details.toBytes()));
        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