@Test
  public void badInputTest() throws Exception {
    List<LogSegmentName> segmentsUnderCompaction =
        Collections.singletonList(LogSegmentName.generateFirstSegmentName(true));

    // details contains no segments
    try {
      new CompactionDetails(1, Collections.emptyList(), null);
      fail("Should have failed because there were no log segments to compact");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }

    // details has a negative ref time.
    try {
      new CompactionDetails(-1, segmentsUnderCompaction, null);
      fail("Should have failed because reference time is < 0");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }

    // 0 ref time is ok.
    new CompactionDetails(0, segmentsUnderCompaction, null);
  }
Tests for bad arguments while constructing {@link CompactionDetails}.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/CompactionDetailsTest.java