@Test
public void testRemoveOverlappingRectangles() throws Exception {

	List<Rectangle> rectangles = new ArrayList<Rectangle>();
	rectangles.add(new Rectangle(0, 0, 80, 80));
	rectangles.add(new Rectangle(10, 10, 100, 100));
	rectangles.add(new Rectangle(0, 0, 90, 90));
	rectangles.add(new Rectangle(0, 0, 90, 90));
	// (0, 0, 80, 80)は(0, 0, 90, 90)に含まれているので削除される
	double[][] expected = { { 10.0, 10.0, 100.0, 100.0 }, { 0.0, 0.0, 90.0, 90.0 } };
	ImageUtils.removeOverlappingRectangles(rectangles);
	assertThat(rectangles.size(), is(2));
	for (int i = 0; i < rectangles.size(); i++) {
		Rectangle rectangle = rectangles.get(i);
		assertThat(rectangle.getX(), is(expected[i][0]));
		assertThat(rectangle.getY(), is(expected[i][1]));
		assertThat(rectangle.getWidth(), is(expected[i][2]));
		assertThat(rectangle.getHeight(), is(expected[i][3]));
	}
}