GridGeometry gg = new GridGeometry2D(new GridEnvelope2D(-10, -10, 5, 5), (Envelope) new Envelope2D(wgs84LonLat, 5, 3, 8, 6));
GridCoverage2D flipped = (GridCoverage2D) Operations.DEFAULT.resample(coverage, wgs84LonLat,
gg, Interpolation.getInstance(Interpolation.INTERP_NEAREST));
// before the fix the pixel would have been black
flipped.evaluate((DirectPosition) new DirectPosition2D(6, 4), pixel);
assertEquals(0, pixel[0]);
assertEquals(255, pixel[1]);
assertEquals(0, pixel[2]);
}