InverseProcessor implements BitmapProcessor { @Override public Bitmap process(Bitmap in) { Matrix matrix = new Matrix(); matrix.setScale(-1, 1); matrix.postTranslate(in.getWidth(), 0); Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; } InverseProcessor(); @Override String getId(); @Override Bitmap process(Bitmap in);  }
@Test public void testReturnsNewBitmap() { Bitmap bitmap = Bitmap.createBitmap(400, 400, Bitmap.Config.ARGB_8888); InverseProcessor processor = new InverseProcessor(); Bitmap result = processor.process(bitmap); Assert.assertNotNull(result); Assert.assertNotSame(bitmap, result); }