@Test
public void readOnlyJpegImage() throws FileNotFoundException, IOException {

    PDColorSpace colorSpace = mock(PDColorSpace.class);
    when(colorSpace.getCOSObject()).thenReturn(COSInteger.TWO);
    victim = ReadOnlyFilteredCOSStream.readOnlyJpegImage(folder.newFile(), 10, 20, 8, colorSpace);
    assertEquals(COSName.XOBJECT, victim.getItem(COSName.TYPE));
    assertEquals(COSName.IMAGE, victim.getItem(COSName.SUBTYPE));
    assertEquals(COSName.DCT_DECODE, victim.getItem(COSName.FILTER));
    assertEquals(8, victim.getInt(COSName.BITS_PER_COMPONENT));
    assertEquals(20, victim.getInt(COSName.HEIGHT));
    assertEquals(10, victim.getInt(COSName.WIDTH));
    assertEquals(COSInteger.TWO, victim.getItem(COSName.COLORSPACE));
}