    @Test
    public void testFromBitmap() {

        Bitmap src = mock(Bitmap.class);
        when(src.getWidth()).thenReturn(16);
        when(src.getHeight()).thenReturn(16);
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocation) throws Throwable {
                int[] pix = invocation.getArgumentAt(0, CLASS_INT_ARRAY);
                for (int i = 0; i < 256; i++)
                    pix[i] = (255 << 24) | (i << 16) | (i << 8) | i;
                return null;
            }
        }).when(src).getPixels(any(CLASS_INT_ARRAY), eq(0), eq(16), eq(0), eq(0), eq(16), eq(16));

        Picture dst = Picture.create(16, 16, ColorSpace.RGB);
        BitmapUtil.fromBitmap(src, dst);
        for (int i = 0; i < 256; i++) {
            Assert.assertEquals(dst.getPlaneData(0)[i * 3], i - 128);
            Assert.assertEquals(dst.getPlaneData(0)[i * 3 + 1], i - 128);
            Assert.assertEquals(dst.getPlaneData(0)[i * 3 + 2], i - 128);
        }
    }