### Question:
SymbolAxis extends NumberAxis implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj); } SymbolAxis(String label, String[] sv); String[] getSymbols(); boolean isGridBandsVisible(); void setGridBandsVisible(boolean flag); Paint getGridBandPaint(); void setGridBandPaint(Paint paint); Paint getGridBandAlternatePaint(); void setGridBandAlternatePaint(Paint paint); @Override AxisState draw(Graphics2D g2,
                          double cursor,
                          Rectangle2D plotArea,
                          Rectangle2D dataArea,
                          RectangleEdge edge,
                          PlotRenderingInfo plotState); @Override List<ValueTick> refreshTicks(Graphics2D g2, AxisState state,
            Rectangle2D dataArea, RectangleEdge edge); String valueToString(double value); @Override boolean equals(Object obj); static final Paint DEFAULT_GRID_BAND_PAINT; static final Paint DEFAULT_GRID_BAND_ALTERNATE_PAINT; }### Answer:
@Test public void testEquals() { SymbolAxis a1 = new SymbolAxis("Axis", new String[] {"A", "B"}); SymbolAxis a2 = new SymbolAxis("Axis", new String[] {"A", "B"}); assertEquals(a1, a2); assertEquals(a2, a1); a1 = new SymbolAxis("Axis 2", new String[] {"A", "B"}); assertFalse(a1.equals(a2)); a2 = new SymbolAxis("Axis 2", new String[] {"A", "B"}); assertEquals(a1, a2); a1 = new SymbolAxis("Axis 2", new String[] {"C", "B"}); assertFalse(a1.equals(a2)); a2 = new SymbolAxis("Axis 2", new String[] {"C", "B"}); assertEquals(a1, a2); a1.setGridBandsVisible(false); assertFalse(a1.equals(a2)); a2.setGridBandsVisible(false); assertEquals(a1, a2); a1.setGridBandPaint(Color.BLACK); assertFalse(a1.equals(a2)); a2.setGridBandPaint(Color.BLACK); assertEquals(a1, a2); a1.setGridBandAlternatePaint(Color.RED); assertFalse(a1.equals(a2)); a2.setGridBandAlternatePaint(Color.RED); assertEquals(a1, a2); }