### Question:
ImageConverter { public byte[] convertImageToByteArray(BufferedImage image) throws ImageProcessException { Validate.notNull(image, "Incoming image cannot be null"); byte[] result; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { if (format.equals("ico")) { ICOEncoder.write(image, ARGB_BITS_COUNT, baos); } else { ImageIO.write(image, format, baos); } baos.flush(); result = baos.toByteArray(); } catch (IOException e) { throw new ImageProcessException(e); } finally { IOUtils.closeQuietly(baos); } return result; } ImageConverter(String format, int imageType, int maxImageWidth, int maxImageHeight); String getFormat(); String getHtmlSrcImagePrefix(); static ImageConverter createConverter(String format, int maxImageWidth, int maxImageHeight); byte[] convertImageToByteArray(BufferedImage image); BufferedImage convertByteArrayToImage(byte[] bytes); BufferedImage resizeImage(BufferedImage image, int type); byte[] preprocessImage(BufferedImage image); String prepareHtmlImgSrc(byte[] avatar);  }### Answer:
@Test(expectedExceptions = {IllegalArgumentException.class}) public void convertImageToByteArrayShouldNotWorkWithPassedNull() throws ImageProcessException { imageConverter.convertImageToByteArray(null); }