@Test
public void testHoleAssignment() {

    java.awt.Dimension ps = new java.awt.Dimension(500, 500);
    PrecisionModel precision = new PrecisionModel();
    ArrayList shells = new ArrayList();
    ArrayList holes = new ArrayList();
    int x = 10;
    int y = 10;
    shells.add(copyTo(x, y, ps.width - 2 * x, ps.height - 2 * y, rectangle(
            precision, 0)));
    int w = 11;
    int h = 11;
    int s = 10;
    int nx = (ps.width - 2 * x) / (w + s);
    int ny = (ps.height - 2 * y) / (h + s);
    for (int i = 0; i < nx; i++) {
        for (int j = 0; j < ny; j++) {
            holes.add(copyTo(x + s + i * (w + s), y + s + j * (h + s), w,
                    h, rectangle(precision, 0)));
        }
    }
    PolygonHandler ph = new PolygonHandler(new GeometryFactory());
    ArrayList assigned = ph.assignHolesToShells(shells, holes);
    assertEquals(((ArrayList) assigned.get(0)).size(), holes.size());
}