double finalRes = calculateResolution(mosaic);
double percentual = Math.abs(initialRes - finalRes) / initialRes;
Assert.assertTrue(percentual < TOLERANCE);
// Check that on the center of the image there are nodata
DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(),
actual.getCenterX(), actual.getCenterY());
double nodata = CoverageUtilities.getBackgroundValues(coverage1)[0];
double result = ((int[]) mosaic.evaluate(point))[0];
Assert.assertEquals(nodata, result, TOLERANCE);
// Check that on the Upper Left border pixel there is valid data
point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), actual.getMinX()
+ finalRes, actual.getMinY() + finalRes);
result = ((int[]) mosaic.evaluate(point))[0];
Assert.assertNotEquals(nodata, result, TOLERANCE);
// Ensure the Layout is already present after the mosaic