private static void assertFilledWithConsecutiveBytes(
      final byte[] byteArray, final int startOffset, final int endOffset, int firstByte) {
    for (int i = startOffset; i < endOffset; ++i) {
      assertEquals((byte) firstByte++, byteArray[i]);
    }
  }
Given byte array, asserts that each byte in (startOffset, endOffset) range has value equal to
value of previous byte plus one (mod 255) and byteArray[startOffset] is equal to firstByte.

@param byteArray
@param startOffset
@param endOffset
@param firstByte
imagepipeline/src/test/java/com/facebook/common/memory/PooledByteArrayBufferedInputStreamTest.java