private static EncodedImage buildEncodedImage(TrivialPooledByteBuffer byteBuffer) {
    return new EncodedImage(CloseableReference.<PooledByteBuffer>of(byteBuffer));
  }
Feeds mProgressiveJpegParser with n initial bytes from byteArray and checks that

@param byteArray
@param n
@param foundNewScan expected return value of ProgressiveJpegParser.parseMoreData
@param expectedBestScan expected number of scans found by the parser + 1
@param bestScanEndOffset offset of expected best scan found so far
imagepipeline/src/test/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParserTest.java