private void testGetLevelImageBounds(int expectedSize, int size, int level, DefaultMultiLevelModel model) {
Rectangle expected = new Rectangle(0, 0, expectedSize, expectedSize);
ResolutionLevel resolutionLevel = new ResolutionLevel(level, model.getScale(level));
ImageLayout imageLayout = ImageManager.createSingleBandedImageLayout(DataBuffer.TYPE_USHORT, size, size, null, resolutionLevel);
assertEquals("at resolution level " + level + ":",
expected,
new Rectangle(imageLayout.getMinX(null),
imageLayout.getMinY(null),
imageLayout.getWidth(null),
imageLayout.getHeight(null))
);
}