public void testCreateBufferedImage() { ImageTypeSpecifier typeSpecifier = ImageTypeSpecifier.createGrayscale(8, DataBuffer.TYPE_BYTE, true); int width = 10; int height = 10; BufferedImage image = typeSpecifier.createBufferedImage(width, height); assertEquals( "Failed to create with the correct ColorModel", typeSpecifier.getColorModel(), image.getColorModel()); assertEquals( "Failed to create with the correct SampleModel", typeSpecifier.getSampleModel().getClass(), image.getSampleModel().getClass()); assertEquals("Failed to create with the correct width", width, image.getWidth()); assertEquals("Failed to create with the correct height", height, image.getHeight()); }