### Question:
WaterfallBarRenderer extends BarRenderer { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtils.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtils.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtils.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtils.equal(this.negativeBarPaint, that.negativeBarPaint)) { return false; } return true; } WaterfallBarRenderer();  WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint,
            Paint negativeBarPaint, Paint lastBarPaint); Paint getFirstBarPaint(); void setFirstBarPaint(Paint paint); Paint getLastBarPaint(); void setLastBarPaint(Paint paint); Paint getPositiveBarPaint(); void setPositiveBarPaint(Paint paint); Paint getNegativeBarPaint(); void setNegativeBarPaint(Paint paint); @Override Range findRangeBounds(CategoryDataset dataset); @Override void drawItem(Graphics2D g2, CategoryItemRendererState state,
            Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
            ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
            int pass); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { WaterfallBarRenderer r1 = new WaterfallBarRenderer(); WaterfallBarRenderer r2 = new WaterfallBarRenderer(); assertEquals(r1, r2); r1.setFirstBarPaint(Color.cyan); assertFalse(r1.equals(r2)); r2.setFirstBarPaint(Color.cyan); assertEquals(r1, r2); r1.setLastBarPaint(Color.cyan); assertFalse(r1.equals(r2)); r2.setLastBarPaint(Color.cyan); assertEquals(r1, r2); r1.setPositiveBarPaint(Color.cyan); assertFalse(r1.equals(r2)); r2.setPositiveBarPaint(Color.cyan); assertEquals(r1, r2); r1.setNegativeBarPaint(Color.cyan); assertFalse(r1.equals(r2)); r2.setNegativeBarPaint(Color.cyan); assertEquals(r1, r2); }