### Question:
ExtendedCategoryAxis extends CategoryAxis { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ExtendedCategoryAxis)) { return false; } ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj; if (!this.sublabelFont.equals(that.sublabelFont)) { return false; } if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) { return false; } if (!this.sublabels.equals(that.sublabels)) { return false; } return super.equals(obj); } ExtendedCategoryAxis(String label); Font getSubLabelFont(); void setSubLabelFont(Font font); Paint getSubLabelPaint(); void setSubLabelPaint(Paint paint); void addSubLabel(Comparable category, String label); @Override boolean equals(Object obj); @Override Object clone();  }### Answer:
@Test public void testEquals() { ExtendedCategoryAxis a1 = new ExtendedCategoryAxis("Test"); ExtendedCategoryAxis a2 = new ExtendedCategoryAxis("Test"); assertEquals(a1, a2); a1.addSubLabel("C1", "C1-sublabel"); assertFalse(a1.equals(a2)); a2.addSubLabel("C1", "C1-sublabel"); assertEquals(a1, a2); a1.setSubLabelFont(new Font("Dialog", Font.BOLD, 8)); assertFalse(a1.equals(a2)); a2.setSubLabelFont(new Font("Dialog", Font.BOLD, 8)); assertEquals(a1, a2); a1.setSubLabelPaint(Color.RED); assertFalse(a1.equals(a2)); a2.setSubLabelPaint(Color.RED); assertEquals(a1, a2); }