final GranuleDescriptor granuleDescriptor = new GranuleDescriptor(DataUtilities.urlToFile(testUrl).getAbsolutePath()
, TEST_BBOX, spi, (MultiLevelROI) null);
assertNotNull(granuleDescriptor.toString());
//Get a GranuleOverviewLevelDescriptor
final GranuleOverviewLevelDescriptor granuleOverviewLevelDescriptor = granuleDescriptor.getLevel(2);
assertNotNull(granuleOverviewLevelDescriptor);
final int h = granuleOverviewLevelDescriptor.getHeight();
final int w = granuleOverviewLevelDescriptor.getWidth();
assertEquals(47, h);
assertEquals(35, w);
final double scaleX = granuleOverviewLevelDescriptor.getScaleX();
final double scaleY = granuleOverviewLevelDescriptor.getScaleY();
assertEquals("ScaleX not equal", scaleX, 4.0d, DELTASCALE);
assertEquals("ScaleY not equal", scaleY, 3.9788d, DELTASCALE);
final Rectangle rect = granuleOverviewLevelDescriptor.getBounds();
assertEquals(rect.x, 0);
assertEquals(rect.y, 0);
assertEquals(rect.width, 35);
assertEquals(rect.height, 47);
final AffineTransform btlTransform = granuleOverviewLevelDescriptor.getBaseToLevelTransform();
final double[] baseMatrix = new double[6];
btlTransform.getMatrix(baseMatrix);
assertEquals("m00 not equal", baseMatrix[0], 4.0d, DELTASCALE);
assertEquals("m10 not equal", baseMatrix[1], 0.0d, DELTA);
assertEquals("m01 not equal", baseMatrix[2], 0.0d, DELTA);
assertEquals("m11 not equal", baseMatrix[3], 3.9788d, DELTASCALE);
assertEquals("m02 not equal", baseMatrix[4], 0.0d, DELTA);
assertEquals("m12 not equal", baseMatrix[5], 0.0d, DELTA);
final AffineTransform2D g2wtTransform = granuleOverviewLevelDescriptor.getGridToWorldTransform();
final double[] g2wMatrix = new double[6];
g2wtTransform.getMatrix(g2wMatrix);
assertEquals("m00 not equal", g2wMatrix[0], 0.08276290425318347d, DELTASCALE);
assertEquals("m10 not equal", g2wMatrix[1], 0.0d, DELTA);
assertEquals("m01 not equal", g2wMatrix[2], 0.0d, DELTA);