### Question:
AverageHash implements ImageHash { @Override public String hash(BufferedImage image) { BufferedImage processedImage = Scalr.resize(image, FIT_EXACT, WIDTH, HEIGHT, OP_GRAYSCALE); int[] rgb = ImageUtils.getRGB(processedImage); double meanValue = Arrays.stream(rgb).map(v -> v & 0xFF).average().getAsDouble(); String bitString = Arrays.stream(ImageUtils.getRGB(processedImage)) .mapToObj(v -> (v & 0xFF) > meanValue ? "1" : "0") .collect(Collectors.joining()); return HashUtil.toHex(bitString, WIDTH * HEIGHT / 4); }  @Override String hash(BufferedImage image);  }### Answer:
@Test public void testAverageHash() throws FileNotFoundException, IOException { BufferedImage image = ImageHandler.load(ResourceHelper.getResourceFile("medium_5530248040.jpg")); String hash = new AverageHash().hash(image); assertEquals("00010638608ffffe", hash); }