RectRegion { public void union(Number x, Number y) { xRegion.union(x); yRegion.union(y); } RectRegion();  RectRegion(XYCoords min, XYCoords max);  RectRegion(Number minX, Number maxX, Number minY, Number maxY, String label);  RectRegion(RectF rect); @SuppressWarnings("SameParameterValue")  RectRegion(Number minX, Number maxX, Number minY, Number maxY); static RectRegion withDefaults(RectRegion defaults); XYCoords transform(Number x, Number y, RectRegion region2, boolean flipX, boolean flipY); XYCoords transform(Number x, Number y, RectRegion region2); XYCoords transform(XYCoords value, RectRegion region2); RectRegion transform(RectRegion r, RectRegion r2, boolean flipX, boolean flipY); PointF transformScreen(Number x, Number y, RectF region2); void transformScreen(PointF result, Number x, Number y, RectF region2); void transform(PointF result, Number x, Number y, RectF region2, boolean flipX, boolean flipY); PointF transform(Number x, Number y, RectF region2, boolean flipX, boolean flipY); PointF transformScreen(XYCoords value, RectF region2); PointF transform(XYCoords value, RectF region2, boolean flipX, boolean flipY); void union(Number x, Number y); void union(RectRegion input); boolean intersects(RectRegion region); boolean intersects(Number minX, Number maxX, Number minY, Number maxY); RectF asRectF(); void intersect(RectRegion clippingBounds); List<RectRegion> intersects(List<RectRegion> regions); Number getWidth(); Number getHeight(); void set(Number minX, Number maxX, Number minY, Number maxY); boolean isMinXSet(); Number getMinX(); void setMinX(Number minX); boolean isMaxXSet(); Number getMaxX(); void setMaxX(Number maxX); boolean isMinYSet(); Number getMinY(); void setMinY(Number minY); boolean isMaxYSet(); Number getMaxY(); void setMaxY(Number maxY); String getLabel(); void setLabel(String label); Region getxRegion(); void setxRegion(Region xRegion); Region getyRegion(); void setyRegion(Region yRegion); boolean isFullyDefined(); boolean contains(Number x, Number y); @Override String toString();  }
@Test public void testUnion() throws Exception { RectRegion r1 = new RectRegion(0, 10, 0, 10); RectRegion r2 = new RectRegion(100, 200, 100, 200); r1.union(r2); assertEquals(0, r1.getMinX().doubleValue(), 0); assertEquals(200, r1.getMaxX().doubleValue(), 0); assertEquals(0, r1.getMinY().doubleValue(), 0); assertEquals(200, r1.getMaxY().doubleValue(), 0); r1 = new RectRegion(0, 10, 0, 10); r2.union(r1); assertEquals(0, r2.getMinX().doubleValue(), 0); assertEquals(200, r2.getMaxX().doubleValue(), 0); assertEquals(0, r2.getMinY().doubleValue(), 0); assertEquals(200, r2.getMaxY().doubleValue(), 0); }