### Question:
ImageUtil { public static BufferedImage flipImage(final BufferedImage image, final boolean horizontal, final boolean vertical) { int x = 0; int y = 0; int w = image.getWidth(); int h = image.getHeight(); final BufferedImage out = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); final Graphics2D g2d = out.createGraphics(); if (horizontal) { x = w; w *= -1; } if (vertical) { y = h; h *= -1; } g2d.drawImage(image, x, y, w, h, null); g2d.dispose(); return out; }  static BufferedImage bufferedImageFromImage(final Image image); static BufferedImage grayscaleOffset(final BufferedImage image, final int offset); static BufferedImage grayscaleOffset(final BufferedImage image, final float percentage); static BufferedImage alphaOffset(final BufferedImage image, final int offset); static BufferedImage alphaOffset(final BufferedImage image, final float percentage); static BufferedImage grayscaleImage(final BufferedImage image); static BufferedImage resizeImage(final BufferedImage image, final int newWidth, final int newHeight); static BufferedImage resizeCanvas(final BufferedImage image, final int newWidth, final int newHeight); static BufferedImage rotateImage(final BufferedImage image, final double theta); static BufferedImage flipImage(final BufferedImage image, final boolean horizontal, final boolean vertical); static BufferedImage outlineImage(final BufferedImage image, final Color color); static BufferedImage outlineImage(final BufferedImage image, final Color color, final Predicate<Color> fillCondition); static BufferedImage outlineImage(final BufferedImage image, final Color color, final Boolean outlineCorners); static BufferedImage outlineImage(final BufferedImage image, final Color color, final Predicate<Color> fillCondition, final Boolean outlineCorners); static BufferedImage getResourceStreamFromClass(final Class c, final String path); static BufferedImage fillImage(final BufferedImage image, final Color color); static SpritePixels getImageSpritePixels(BufferedImage image, Client client);  }### Answer:
@Test public void flipImage() { assertTrue(bufferedImagesEqual(BLACK_PIXEL_TOP_LEFT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, false, false))); assertTrue(bufferedImagesEqual(BLACK_PIXEL_TOP_RIGHT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, true, false))); assertTrue(bufferedImagesEqual(BLACK_PIXEL_BOTTOM_LEFT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, false, true))); assertTrue(bufferedImagesEqual(BLACK_PIXEL_BOTTOM_RIGHT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, true, true))); }
@Test public void flipImage() { assert(bufferedImagesEqual(BLACK_PIXEL_TOP_LEFT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, false, false))); assert(bufferedImagesEqual(BLACK_PIXEL_TOP_RIGHT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, true, false))); assert(bufferedImagesEqual(BLACK_PIXEL_BOTTOM_LEFT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, false, true))); assert(bufferedImagesEqual(BLACK_PIXEL_BOTTOM_RIGHT, ImageUtil.flipImage(BLACK_PIXEL_TOP_LEFT, true, true))); }