@Test
public void testConvertDiffPointsToObjectGroups() throws Exception {

	BufferedImage image1 = ImageIO
			.read(getClass().getResource("ImageUtilsTest_convert_object_groups_to_areas_expected.png"));
	Rectangle rectangle1 = new Rectangle(0, 0, image1.getWidth(), image1.getHeight());
	BufferedImage image2 = ImageIO
			.read(getClass().getResource("ImageUtilsTest_convert_object_groups_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.convertDiffPointsToObjectGroups内の計算でObjectGroupを作成するので、expectedの値もObjectGroupのマージンを考慮
	int x = 1;
	int y = 0;
	int width = 3;
	int height = 2;
	int margin = DEFAULT_GROUP_DISTANCE / 2;
	Rectangle expected = new Rectangle(x - margin, y - margin, 2 * margin + width, 2 * margin + height);
	List<ObjectGroup> actual = ImageUtils.convertDiffPointsToObjectGroups(diffPoints, DEFAULT_GROUP_DISTANCE);
	assertThat(actual.size(), is(1));
	assertThat(actual.get(0).getRectangle(), is(expected));
}