### Question:
BasicImaging implements Imaging { @Override public Image affineTransform(Image image, AffineTransform atf) { BufferedImage src = get(image); AffineTransformOp op = new AffineTransformOp(atf, TYPE_BICUBIC); double[] box = new double[4]; image.toArray(box); atf.transform(box, 0, box, 0, 2); PixelRange trPixelRange = PixelRange.fromArray(box); BufferedImage dst = createCompatibleBufferedImage(image, trPixelRange.getDimension()); op.filter(src, dst); return new BasicImage(dst, trPixelRange.getMinX(), trPixelRange.getMinY()); }  @Override Image createEmptyImage(Dimension dimension, ImageFormat tileImageFormat); @Override Image createEmptyImage(Image baseImage, Dimension dimension); @Override Image mosaic(java.util.List<Image> images, PixelRange imgBounds); @Override Image crop(Image source, PixelRange cropBnds); @Override Image scale(Image source, Dimension dimension); @Override Image overlay(Image src1, Image src2); @Override Image affineTransform(Image image, AffineTransform atf); @Override Image affineTransform(Image image, int tx, int ty, double sx, double sy); @Override Image read(InputStream is, int minX, int minY, boolean forceArgb); @Override Image fromRenderedImage(RenderedImage image); @Override Image reprojectByWarping(Image srcImg, MapUnitToPixelTransform mupTransform, CrsId srs, CoordinateReferenceSystem<?> requestedSRS, MapUnitToPixelTransform targetMupTransform, double v);  }### Answer:
@Test public void testAffineTransformTranslateAndScale() throws IOException { Image img1 = readTileImage("test3.png", false); Image result = imaging.affineTransform(img1, 100, 50, 0.5, 1.0); assertEquals(100, result.getMinX()); assertEquals(50, result.getMinY()); assertEquals(256, result.getHeight()); assertEquals(128, result.getWidth(), 0.00001); Image received = imageAfterIO(result, ImageFormat.PNG); Image expected = readTileImage("test3-transform-scale-translate.png", true); assertImageEquals(expected, received); }