@Test
public void testScanLineOffset() throws URISyntaxException, IOException {

    Product product = ProductIO.readProduct(new File(getClass().getResource("bowtiepixelgeocoding_test_product.L2_sub").toURI()));
    // latitude values increasing
    BowtiePixelGeoCoding bowtiePixelGeoCoding = (BowtiePixelGeoCoding) product.getSceneGeoCoding();
    assertEquals(0, bowtiePixelGeoCoding.getScanlineOffset());
    // flipped product, latitude values decreasing
    Product flippedProduct = ProductFlipper.createFlippedProduct(product, ProductFlipper.FLIP_BOTH, "f", "f");
    bowtiePixelGeoCoding = (BowtiePixelGeoCoding) flippedProduct.getSceneGeoCoding();
    assertEquals(0, bowtiePixelGeoCoding.getScanlineOffset());
    // small product, just one scan (10 lines)
    testScanlineOffsetOnSubset(product, 0, 10, 0);
    // other small products, with different offsets
    testScanlineOffsetOnSubset(product, 0, 30, 0);
    testScanlineOffsetOnSubset(product, 1, 30, 9);
    testScanlineOffsetOnSubset(product, 2, 30, 8);
    testScanlineOffsetOnSubset(product, 3, 30, 7);
    testScanlineOffsetOnSubset(product, 4, 30, 6);
    testScanlineOffsetOnSubset(product, 5, 30, 5);
    testScanlineOffsetOnSubset(product, 6, 30, 4);
    testScanlineOffsetOnSubset(product, 7, 30, 3);
    testScanlineOffsetOnSubset(product, 8, 30, 2);
    testScanlineOffsetOnSubset(product, 9, 30, 1);
    testScanlineOffsetOnSubset(product, 10, 30, 0);
}