ESRIBounds implements Comparable<ESRIBounds> { @Pure @Override public int compareTo(ESRIBounds bounds) { if (bounds == null) { return -1; } int cmp = (int) Math.signum(bounds.minx - this.minx); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.maxx - this.maxx); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.miny - this.miny); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.maxy - this.maxy); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.minz - this.minz); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.maxz - this.maxz); if (cmp != 0) { return cmp; } cmp = (int) Math.signum(bounds.minm - this.minm); if (cmp != 0) { return cmp; } return (int) Math.signum(bounds.maxm - this.maxm); } 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 testCompareTo() { assertEquals(-1, this.bounds.compareTo(null)); assertEquals(0, this.bounds.compareTo(this.bounds)); assertEquals(0, this.bounds.compareTo(new ESRIBounds(this.bounds))); assertEquals(1, this.bounds.compareTo(new ESRIBounds())); assertEquals(0, this.bounds.compareTo(new ESRIBounds( this.minx, this.maxx, this.miny, this.maxy, this.minz, this.maxz, this.minm, this.maxm))); assertEquals(-1, this.bounds.compareTo(new ESRIBounds( this.minx-1, this.maxx, this.miny, this.maxy, this.minz, this.maxz, this.minm, this.maxm))); assertEquals(1, this.bounds.compareTo(new ESRIBounds( this.minx+1, this.maxx, this.miny, this.maxy, this.minz, this.maxz, this.minm, this.maxm))); assertEquals(-1, this.bounds.compareTo(new ESRIBounds( this.minx-1, this.maxx, this.miny-1, this.maxy, this.minz, this.maxz, this.minm, this.maxm))); assertEquals(1, this.bounds.compareTo(new ESRIBounds( this.minx+1, this.maxx, this.miny-1, this.maxy, this.minz, this.maxz, this.minm, this.maxm))); }