### Question:
ConvertImage { public static BufferedImage boostedGray(BufferedImage image) { BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB); for (int i = 0; i < image.getWidth(); i++) { for (int j = 0; j < image.getHeight(); j++) { int argb = image.getRGB(i,j); int a = ARGB.rawA(argb); int r = ARGB.rawR(argb); int g = ARGB.rawG(argb); int b = ARGB.rawB(argb); int val = (r+r+r+b+g+g+g+g)/8; out.setRGB(i,j, ARGB.toARGB(a, val, val, val)); } } return out; }  static BufferedImage grayscale(BufferedImage image); static BufferedImage boostedGray(BufferedImage image); static BufferedImage otherGray(BufferedImage image);  }### Answer:
@Test public void testBoostedGray() throws Exception { BufferedImage im = new BufferedImage(300, 300, BufferedImage.TYPE_INT_ARGB); for (int i = 0; i < im.getWidth(); i++) { for (int j = 0; j < im.getHeight(); j++) { im.setRGB(i, j, ARGB.toARGB(1, 1, 1, 1)); } } BufferedImage grayscale = ConvertImage.boostedGray(im); int px = grayscale.getRGB(0, 0); Assert.assertEquals(ARGB.getB(px), ARGB.getR(px), 0.001); }