### Question:
GraphicsUtils { public static boolean isImage( final InputStream stream ) { try { return null != ImageIO.read( stream ); } catch ( IOException e ) { Log.debug( "An exception occurred while determining if data represents an image.", e ); return false; } }  static boolean isImage( final InputStream stream ); static boolean isImage( final byte[] bytes );  }### Answer:
@Test public void testIsImageWithImage() throws Exception { final InputStream input = getClass().getResourceAsStream( "/images/ant_logo_large.gif" ); final boolean result = GraphicsUtils.isImage( input ); assertTrue( result ); }
@Test public void testIsImageWithFavicon() throws Exception { final InputStream input = getClass().getResourceAsStream( "/favicon.ico" ); final boolean result = GraphicsUtils.isImage( input ); assertTrue( result ); }
@Test public void testIsImageWithNonImage() throws Exception { final InputStream input = getClass().getResourceAsStream( "/privatekey.pem" ); final boolean result = GraphicsUtils.isImage( input ); assertFalse( result ); }