### Question:
DialCap extends AbstractDialLayer implements DialLayer, Cloneable,
        PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialCap)) { return false; } DialCap that = (DialCap) obj; if (this.radius != that.radius) { return false; } if (!PaintUtils.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtils.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!this.outlineStroke.equals(that.outlineStroke)) { return false; } return super.equals(obj); } DialCap(); double getRadius(); void setRadius(double radius); Paint getFillPaint(); void setFillPaint(Paint paint); Paint getOutlinePaint(); void setOutlinePaint(Paint paint); Stroke getOutlineStroke(); void setOutlineStroke(Stroke stroke); @Override boolean isClippedToWindow(); @Override void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame,
            Rectangle2D view); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testEquals() { DialCap c1 = new DialCap(); DialCap c2 = new DialCap(); assertEquals(c1, c2); c1.setRadius(0.5); assertFalse(c1.equals(c2)); c2.setRadius(0.5); assertEquals(c1, c2); c1.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.BLUE, 3.0f, 4.0f, Color.green)); assertFalse(c1.equals(c2)); c2.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.BLUE, 3.0f, 4.0f, Color.green)); c1.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.gray)); assertFalse(c1.equals(c2)); c2.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.gray)); assertEquals(c1, c2); c1.setOutlineStroke(new BasicStroke(1.1f)); assertFalse(c1.equals(c2)); c2.setOutlineStroke(new BasicStroke(1.1f)); assertEquals(c1, c2); c1.setVisible(false); assertFalse(c1.equals(c2)); c2.setVisible(false); assertEquals(c1, c2); }