RectRegion { public boolean intersects(RectRegion region) { return intersects(region.getMinX(), region.getMaxX(), region.getMinY(), region.getMaxY()); } 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 testIsWithin() throws Exception { RectRegion region1 = new RectRegion(0, 100, 0, 100, ""); RectRegion region2 = new RectRegion(5, 10, 5, 10, ""); assertTrue(region1.intersects(region2)); assertTrue(region2.intersects(region1)); RectRegion region3 = new RectRegion(101, 200, 101, 200, ""); assertFalse(region1.intersects(region3)); assertFalse(region3.intersects(region1)); RectRegion region4 = new RectRegion(99, 109, 99, 109, ""); assertTrue(region1.intersects(region4)); assertTrue(region4.intersects(region1)); RectRegion region5 = new RectRegion(-100, 1, -100, 1, ""); assertTrue(region1.intersects(region5)); assertTrue(region5.intersects(region1)); }
@Test public void testIntersects() throws Exception { RectRegion r1 = new RectRegion(0, 10, 0, 10); RectRegion r2 = new RectRegion(5, 15, 5, 15); RectRegion r3 = new RectRegion(11, 21, 11, 21); assertTrue(r1.intersects(r2)); assertTrue(r2.intersects(r1)); assertFalse(r1.intersects(r3)); assertFalse(r3.intersects(r1)); assertTrue(r2.intersects(r3)); assertTrue(r3.intersects(r2)); }