@Test
public void testCompare_different_area() throws Exception {

	BufferedImage image = ImageIO.read(getClass().getResource("hifive_logo.png"));
	Rectangle rectangle1 = new Rectangle(0, 0, image.getWidth(), image.getHeight());
	Rectangle rectangle2 = new Rectangle(0, 0, image.getWidth() - 1, image.getHeight() - 1);
	DiffPoints result = (DiffPoints) new DefaultImageComparator().compare(image, rectangle1, image, rectangle2);
	assertThat(result.isFailed(), is(true));
	assertThat(result.getDiffPoints().isEmpty(), is(true));
	assertThat(result.getSizeDiffPoints().isEmpty(), is(false));
	Comparator<Point> comparator = new Comparator<Point>() {
		@Override
		public int compare(Point o1, Point o2) {
			if (o1.x != o2.x)
				return Integer.compare(o1.x, o2.x);
			if (o1.y != o2.y)
				return Integer.compare(o1.y, o2.y);
			return 0;
		}
	};
	Set<Point> expectedDiffPoints = new TreeSet<Point>(comparator);
	for (int x = 0; x < image.getWidth(); x++) {
		expectedDiffPoints.add(new Point(x, image.getHeight()));
	}
	for (int y = 0; y < image.getHeight(); y++) {
		expectedDiffPoints.add(new Point(image.getWidth(), y));
	}
	Set<Point> diffPoints = new TreeSet<Point>(comparator);
	diffPoints.addAll(result.getSizeDiffPoints());
	assertThat(diffPoints, is(expectedDiffPoints));
}