### Question:
BorderPainter implements Drawable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BorderPainter)) { return false; } BorderPainter that = (BorderPainter) obj; if (!this.color.equals(that.color)) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } if (this.arcHeight != that.arcHeight) { return false; } if (this.arcWidth != that.arcWidth) { return false; } return true; } BorderPainter();  BorderPainter(Color color, Stroke stroke);  BorderPainter(Color color, Stroke stroke, double arcH, double arcW); Color getColor(); Stroke getStroke(); double getArcHeight(); double getArcWidth(); @Override void draw(Graphics2D g2, Rectangle2D area); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { BorderPainter p1 = new BorderPainter(Color.RED, new BasicStroke(1.0f), 1.0, 2.0); BorderPainter p2 = new BorderPainter(Color.RED, new BasicStroke(1.0f), 1.0, 2.0); assertEquals(p1, p2); p1 = new BorderPainter(Color.BLUE, new BasicStroke(1.0f), 1.0, 2.0); assertNotEquals(p1, p2); p2 = new BorderPainter(Color.BLUE, new BasicStroke(1.0f), 1.0, 2.0); assertEquals(p1, p2); p1 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 1.0, 2.0); assertNotEquals(p1, p2); p2 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 1.0, 2.0); assertEquals(p1, p2); p1 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 3.0, 2.0); assertNotEquals(p1, p2); p2 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 3.0, 2.0); assertEquals(p1, p2); p1 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 3.0, 4.0); assertNotEquals(p1, p2); p2 = new BorderPainter(Color.BLUE, new BasicStroke(2.0f), 3.0, 4.0); assertEquals(p1, p2); }