@Test
public void testConvertDiffPointsToAreas() throws Exception {

	BufferedImage image1 = ImageIO
			.read(getClass().getResource("ImageUtilsTest_convert_diff_points_to_areas_expected.png"));
	Rectangle rectangle1 = new Rectangle(0, 0, image1.getWidth(), image1.getHeight());
	BufferedImage image2 = ImageIO
			.read(getClass().getResource("ImageUtilsTest_convert_diff_points_to_areas_actual.png"));
	Rectangle rectangle2 = new Rectangle(0, 0, image2.getWidth(), image2.getHeight());
	ImageComparedResult result = new DefaultImageComparator().compare(image1, rectangle1, image2, rectangle2);
	List<Point> points = ((DiffPoints) result).getDiffPoints();
	DiffPoints diffPoints = new DiffPoints(points, new ArrayList<Point>());
	// ImageUtils.convertDiffPointsToAreas内の計算でObjectGroupを作成するので、expectedの値もObjectGroupのマージンを考慮
	int x = 1;
	int y = 0;
	int width = 3;
	int height = 2;
	int margin = DEFAULT_GROUP_DISTANCE / 2;
	List<Rectangle> expected = new ArrayList<Rectangle>();
	expected.add(new Rectangle(x - margin, y - margin, 2 * margin + width, 2 * margin + height));
	List<Rectangle> actual;
	// 引数がDiffPoints diffPointsの場合
	actual = ImageUtils.convertDiffPointsToAreas(diffPoints);
	assertThat(actual, is(expected));
	// 引数がList<Point> diffPointsの場合
	actual = ImageUtils.convertDiffPointsToAreas(points);
	assertThat(actual, is(expected));
}