@Test
public void testToIntArrayArray() throws Exception {

    BufferedImage img = makeRandomBufferedImage(true);
    int w = img.getWidth();
    int h = img.getHeight();
    int ch = 4;
    ImageLoader loader = new ImageLoader(0, 0, ch);
    int[][] arr = loader.toIntArrayArray(img);
    assertEquals(h, arr.length);
    assertEquals(w, arr[0].length);
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            assertEquals(img.getRGB(j, i), arr[i][j]);
        }
    }
}