@Test
  public void setActiveSegmentBadArgsTest() throws IOException, StoreException {
    Log log = new Log(tempDir.getAbsolutePath(), LOG_CAPACITY, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR,
        createStoreConfig(SEGMENT_CAPACITY, setFilePermissionEnabled), metrics, null);
    long numSegments = LOG_CAPACITY / SEGMENT_CAPACITY;
    try {
      log.setActiveSegment(LogSegmentName.fromPositionAndGeneration(numSegments + 1, 0));
      fail("Should have failed to set a non existent segment as active");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    } finally {
      log.close(false);
      cleanDirectory(tempDir);
    }
  }
Tests cases where bad arguments are provided to {@link Log#setActiveSegment(LogSegmentName)}.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/LogTest.java