### Question:
Rectangle { boolean intersectsWith(Rectangle r) { return !(r.getLeft() > getRight() || r.getRight() < getLeft() || r.getTop() > getBottom() || r .getBottom() < getTop()); } Rectangle(int left, int top, int right, int bottom); int getLeft(); int getTop(); int getRight(); int getBottom(); @Override String toString();  }### Answer:
@Test public void testIntersection() { assertTrue(new Rectangle(0, 0, 1, 1).intersectsWith(new Rectangle(0, 0, 1, 1))); assertTrue(new Rectangle(0, 0, 1, 1).intersectsWith(new Rectangle(-1, -5, 7, 8))); assertFalse(new Rectangle(0, 0, 1, 1).intersectsWith(new Rectangle(2, 2, 3, 3))); assertFalse(new Rectangle(0, 0, 1, 1).intersectsWith(new Rectangle(-2, -2, -1, -1))); }