ESRIBounds implements Comparable<ESRIBounds> { public void add(ESRIPoint point) { if (point.getX() < this.minx) { this.minx = point.getX(); } if (point.getX() > this.maxx) { this.maxx = point.getX(); } if (point.getY() < this.miny) { this.miny = point.getY(); } if (point.getY() > this.maxy) { this.maxy = point.getY(); } if (point.getZ() < this.minz) { this.minz = point.getZ(); } if (point.getZ() > this.maxz) { this.maxz = point.getZ(); } if (point.getM() < this.minm) { this.minm = point.getM(); } if (point.getM() > this.maxm) { this.maxm = point.getM(); } } ESRIBounds();  ESRIBounds(ESRIPoint point);  ESRIBounds(double minx, double maxx, double miny, double maxy);  ESRIBounds(double minx, double maxx, double miny, double maxy, double minz, double maxz, double minm, double maxm);  ESRIBounds(ESRIBounds bounds); ESRIBounds createUnion(ESRIBounds bounds); void add(ESRIPoint point); @Override @Pure boolean equals(Object obj); @Pure @Override int hashCode(); @Pure @Override int compareTo(ESRIBounds bounds); @Pure double getMinX(); @Pure double getCenterX(); @Pure double getMaxX(); @Pure double getCenterY(); @Pure double getMinY(); @Pure double getMaxY(); @Pure double getMinZ(); @Pure double getCenterZ(); @Pure double getMaxZ(); @Pure double getMinM(); @Pure double getCenterM(); @Pure double getMaxM(); @Pure Rectangle2d toRectangle2d(); void ensureMinMax(); @Pure @Override String toString();  }
@Test public void testAdd() { double px = getRandom().nextDouble(); double py = getRandom().nextDouble(); double pz = -getRandom().nextDouble(); double pm = getRandom().nextDouble(); double x = Math.min(this.minx, px); double X = Math.max(this.maxx, px); double y = Math.min(this.miny, py); double Y = Math.max(this.maxy, py); double z = Math.min(this.minz, pz); double Z = Math.max(this.maxz, pz); double m = Math.min(this.minm, pm); double M = Math.max(this.maxm, pm); this.bounds.add(new ESRIPoint(px, py, pz, pm)); assertEpsilonEquals(x, this.bounds.getMinX()); assertEpsilonEquals(X, this.bounds.getMaxX()); assertEpsilonEquals(y, this.bounds.getMinY()); assertEpsilonEquals(Y, this.bounds.getMaxY()); assertEpsilonEquals(z, this.bounds.getMinZ()); assertEpsilonEquals(Z, this.bounds.getMaxZ()); assertEpsilonEquals(m, this.bounds.getMinM()); assertEpsilonEquals(M, this.bounds.getMaxM()); }