private void verifyInvalidValueSize(IndexValue value, LogSegmentName logSegmentName) {
    int capacity = TestUtils.RANDOM.nextInt(value.getBytes().capacity());
    ByteBuffer invalidValue = ByteBuffer.allocate(capacity);
    invalidValue.put(value.getBytes().array(), 0, capacity);
    try {
      new IndexValue(logSegmentName, invalidValue, version);
      fail("Construction of IndexValue expected to fail with invalid byte buffer capacity of "
          + invalidValue.capacity());
    } catch (IllegalArgumentException e) {
    }
  }
Verifies that construction of {@link IndexValue} fails with an invalid {@link ByteBuffer} value
@param value the source {@link IndexValue} to construct the bad one
@param logSegmentName the log segment name to be used to construct the {@link IndexValue}
ambry-store/src/test/java/com/github/ambry/store/IndexValueTest.java