while (i.hasNext()) { HatchBoundaryLoop loop = (HatchBoundaryLoop) i.next(); Bounds b = loop.getBounds();
while (i.hasNext()) {  HatchBoundaryLoop loop = (HatchBoundaryLoop) i.next(); Bounds b = loop.getBounds();  if (b.isValid()) { bounds.addToBounds(b); } }
    public Bounds getBounds() {        Bounds bounds = new Bounds();        Iterator i = boundaries.iterator();        while (i.hasNext()) {            HatchBoundaryLoop loop = (HatchBoundaryLoop) i.next();            Bounds b = loop.getBounds();            if (b.isValid()) {                bounds.addToBounds(b);            }        }        return bounds;    }