@Test
  public void getNextPositionAndGenerationTest() {
    for (int i = 0; i < 10; i++) {
      long pos = Utils.getRandomLong(TestUtils.RANDOM, 1000);
      long gen = Utils.getRandomLong(TestUtils.RANDOM, 1000);
      LogSegmentName name = LogSegmentName.fromPositionAndGeneration(pos, gen);
      checkPosAndGeneration(name.getNextPositionName(), pos + 1, 0);
      checkPosAndGeneration(name.getNextGenerationName(), pos, gen + 1);
    }
    try {
      LogSegmentName.fromString("").getNextPositionName();
      fail("Should have failed to get next position for empty log segment name");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }
    try {
      LogSegmentName.fromString("").getNextGenerationName();
      fail("Should have failed to get next generation for empty log segment name");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }
  }
Tests correctness of {@link LogSegmentName#getNextPositionName} and
{@link LogSegmentName#getNextGenerationName}.
ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameTest.java