@Test
  public void getAbsolutePositionForOffsetBadArgsTest() {
    Offset badSegmentOffset =
        new Offset(LogSegmentName.fromPositionAndGeneration(state.index.getLogSegmentCount() + 1, 0), 0);
    Offset badOffsetOffset =
        new Offset(state.log.getFirstSegment().getName(), state.log.getFirstSegment().getCapacityInBytes() + 1);
    List<Offset> offsetsToCheck = new ArrayList<>();
    offsetsToCheck.add(badSegmentOffset);
    offsetsToCheck.add(badOffsetOffset);

    for (Offset offset : offsetsToCheck) {
      try {
        state.index.getAbsolutePositionInLogForOffset(offset);
        fail("Should have failed to get absolute position for invalid offset input: " + offset);
      } catch (IllegalArgumentException e) {
        // expected. Nothing to do.
      }
    }
  }
Tests {@link PersistentIndex#getAbsolutePositionInLogForOffset(Offset)} with bad arguments.
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java