### Question:
TemporaryArcView extends JComponent { public void setEnd(Point2D end) { this.end = end; updateMax(end); updateBounds(); } TemporaryArcView(T source, ArcHead arcHead); void setEnd(Point2D end); void addIntermediatePoint(ArcPoint point); T getSourceConnectable(); @Override void paintComponent(Graphics g); @Override boolean contains(int x, int y); Point2D getLastPoint(); List<ArcPoint> getIntermediatePoints();  }### Answer:
@Test public void updatesBoundsIfMouseLargerThanPlace() { Point2D mouse = new Point2D.Double(300, 300); temporaryArcView.setEnd(mouse); Rectangle expected = new Rectangle(0, 0, (int) mouse.getX(), (int) mouse.getY()); Rectangle actual = temporaryArcView.getBounds(); assertEquals(expected, actual); }
@Test public void keepsLargestBoundsIfMouseLessThanLargest() { Point2D mouse = new Point2D.Double(10, 20); temporaryArcView.setEnd(mouse); Point2D centre = place.getCentre(); Rectangle expected = new Rectangle(0, 0, (int) centre.getX(), (int) centre.getY()); Rectangle actual = temporaryArcView.getBounds(); assertEquals(expected, actual); }
@Test public void ensuresLargestIfXIsNewAndYIsExisting() { Point2D mouse = new Point2D.Double(10, 200); temporaryArcView.setEnd(mouse); Point2D centre = place.getCentre(); Rectangle expected = new Rectangle(0, 0, (int) centre.getX(), (int) mouse.getY()); Rectangle actual = temporaryArcView.getBounds(); assertEquals(expected, actual); }