@Test
    public void testIsImageWithNonImage() throws Exception
    {
        // Setup test fixture.
        final InputStream input = getClass().getResourceAsStream( "/privatekey.pem" );

        // Execute system under test.
        final boolean result = GraphicsUtils.isImage( input );

        // Verify result.
        assertFalse( result );
    }
Verifies that {@link GraphicsUtils#isImage(InputStream)} rejects data that's not an image.
xmppserver/src/test/java/org/jivesoftware/util/GraphicsUtilsTest.java