// Check that the final Coverage resolution is equal to that of the first coverage
double finalRes = calculateResolution(mosaic);
// Check that on the center of the image there is valid data
DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(),
expected.getCenterX(), expected.getCenterY());
double nodata = 0;
double result = ((byte[]) mosaic.evaluate(point))[0];
Assert.assertNotEquals(nodata, result, TOLERANCE);
// Check that on the Upper Left border pixel there is valid data
point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMinX()
+ finalRes, expected.getMinY() + finalRes);
result = ((byte[]) mosaic.evaluate(point))[0];
Assert.assertNotEquals(nodata, result, TOLERANCE);
// Check that on the Upper Right border pixel there is valid data
point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMaxX()
- finalRes, expected.getMinY() + finalRes);
result = ((byte[]) mosaic.evaluate(point))[0];
Assert.assertNotEquals(nodata, result, TOLERANCE);
// Coverage and RenderedImage disposal