@Test
public void testInvalidData() {

    byte[] invalidImage = {123, 012, 45, -3, -102};
    try {
        ypJson.processImage(invalidImage);
        fail("Should throw Exception when not a jpeg");
    } catch (ImageProcessingException e) {
        assertTrue("Failure should be caused by invalid image type. Error actually was: " + e.getMessage()
                , e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".invalidImage"));
    }
    try {
        ypJson.processImage(invalidImage);
        fail("Should throw Exception when not a jpeg");
    } catch (ImageProcessingException e) {
        assertTrue("Failure should be caused by invalid image type. Error actually was: " + e.getMessage()
                , e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".invalidImage"));
    }
}