### Question:
Graphics { public static ImageBuffer getImageBuffer(Media media) { return factoryGraphic.getImageBuffer(media); } private  Graphics(); static void setFactoryGraphic(FactoryGraphic factoryGraphic); static Screen createScreen(Config config); static Graphic createGraphic(); static Transform createTransform(); static Text createText(int size); static Text createText(String fontName, int size, TextStyle style); static ImageBuffer createImageBuffer(int width, int height); static ImageBuffer createImageBuffer(int width, int height, ColorRgba transparency); static ImageBuffer getImageBuffer(Media media); static ImageBuffer getImageBuffer(ImageBuffer imageBuffer); static ImageBuffer applyMask(ImageBuffer imageBuffer, ColorRgba maskColor); static ImageBuffer[] splitImage(ImageBuffer image, int h, int v); static ImageBuffer rotate(ImageBuffer image, int angle); static ImageBuffer resize(ImageBuffer image, int width, int height); static ImageBuffer flipHorizontal(ImageBuffer image); static ImageBuffer flipVertical(ImageBuffer image); static void saveImage(ImageBuffer image, Media media); static ImageBuffer getRasterBuffer(ImageBuffer img, double fr, double fg, double fb);  }### Answer:
@Test void testGetImageBufferFromMedia() { final Media media = Medias.create("image.png"); final ImageBuffer imageA = Graphics.getImageBuffer(media); final ImageBuffer imageB = Graphics.getImageBuffer(media); assertNotEquals(imageA, imageB); assertEquals(imageB.getWidth(), imageA.getWidth()); assertEquals(imageB.getHeight(), imageA.getHeight()); imageA.dispose(); imageB.dispose(); }
@Test void testGetImageBufferFailureMedia() { assertThrows(() -> Graphics.getImageBuffer(Medias.create("null")), "[null] Error on reading image !"); }
@Test void testGetImageBufferFailureWrongImage() { assertThrows(() -> Graphics.getImageBuffer(Medias.create("wrong_image.png")), "[wrong_image.png] Error on reading image !"); }