throws IOException {
int numColorComponents = gray > -1 ? 1 : 3;
int numComponents = numColorComponents + (alpha > -1 ? 1 : 0);
ComponentColorModel cm = mock(ComponentColorModel.class);
ImageRawPNG irpng = mock(ImageRawPNG.class);
PDFDocument doc = mock(PDFDocument.class);
PDFProfile profile = mock(PDFProfile.class);
ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
ImageSize is = RawPNGTestUtil.getImageSize();
when(irpng.getColorModel()).thenReturn(cm);
when(cm.getNumComponents()).thenReturn(numComponents);
// when(cm.hasAlpha()).thenReturn(false);
when(doc.getProfile()).thenReturn(profile);
when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
when(irpng.getSize()).thenReturn(is);
irpnga.setup(doc);
FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
assertEquals(numColorComponents, filter.getColors());