@Test
  public void getNextSegmentBadArgsTest() throws IOException, StoreException {
    Log log = new Log(tempDir.getAbsolutePath(), LOG_CAPACITY, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR,
        createStoreConfig(SEGMENT_CAPACITY, setFilePermissionEnabled), metrics, null);
    LogSegment segment = getLogSegment(LogSegmentName.fromPositionAndGeneration(1, 1), SEGMENT_CAPACITY, true);
    try {
      log.getNextSegment(segment);
      fail("Getting next segment should have failed because provided segment does not exist in the log");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    } finally {
      log.close(false);
      cleanDirectory(tempDir);
    }
  }
Tests cases where bad arguments are provided to {@link Log#getNextSegment(LogSegment)}.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/LogTest.java