static bool rgbImageSectionsIdentical(RGBImage a, Rect r1, RGBImage b, Rect r2) { assertEquals(r1.w, r2.w); assertEquals(r1.h, r2.h); int w = r1.w, h = r1.h; for (int yy = 0; yy < h; yy++) for (int xx = 0; xx < w; xx++) if (a.getInt(r1.x+xx, r1.y+yy) != b.getInt(r2.x+xx, r2.y+yy)) false; true; }