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