### Question:
ImageUtil { public static String getContentType(byte[] content) throws MagicParseException, MagicException, MagicMatchNotFoundException { MagicMatch match = Magic.getMagicMatch(content); return match.getMimeType(); }  static void toFile(String oldFile, String newFile, ImageParamDTO params); static BufferedImage toBufferedImage(String oldFile, ImageParamDTO params); static OutputStream toOutputStream(InputStream input, OutputStream output, ImageParamDTO params); static String getContentType(byte[] content); static final InputStream bytes2InputStream(byte[] buf); static final byte[] inputStream2bytes(InputStream inStream);  }### Answer:
@Test public void testGetContentType() throws MagicParseException, MagicException, MagicMatchNotFoundException, IOException { final String oldFile = System.getProperty("user.dir") + "/src/test/resources/images/lion2.jpg"; byte[] bytes = toBytes(new File(oldFile)); String type = ImageUtil.getContentType(bytes); Assert.assertEquals("image/jpeg", type); }