### Question:
ToolsAwt { public static BufferedImage getImage(InputStream input) throws IOException { final BufferedImage buffer = ImageIO.read(input); if (buffer == null) { throw new IOException("Invalid image !"); } return copyImage(buffer); } private  ToolsAwt(); static int getTransparency(Transparency transparency); static BufferedImage createImage(int width, int height, int transparency); static BufferedImage getImage(InputStream input); static ImageBuffer getImageBuffer(BufferedImage image); static void saveImage(BufferedImage image, OutputStream output); static BufferedImage copyImage(BufferedImage image); static int[] getImageData(BufferedImage image); static BufferedImage applyMask(BufferedImage image, int rgba); static BufferedImage rotate(BufferedImage image, int angle); static BufferedImage resize(BufferedImage image, int width, int height); static BufferedImage flipHorizontal(BufferedImage image); static BufferedImage flipVertical(BufferedImage image); static BufferedImage[] splitImage(BufferedImage image, int h, int v); static BufferedImage getRasterBuffer(BufferedImage image, double fr, double fg, double fb); static Cursor createHiddenCursor(); static void createBufferStrategy(java.awt.Canvas component, GraphicsConfiguration conf); static void createBufferStrategy(java.awt.Window component, GraphicsConfiguration conf); static void optimizeGraphicsQuality(Graphics2D g); static void optimizeGraphicsSpeed(Graphics2D g);  }### Answer:
@Test void testGetIoFail() throws IOException { final Media media = Medias.create("raster.xml"); try (InputStream input = media.getInputStream()) { assertThrows(IOException.class, () -> ToolsAwt.getImage(input), "Invalid image !"); } }