### Question:
Axis implements Cloneable, Serializable { @Override public int hashCode() { if (getLabel() != null) { String s = AttributedStringUtils.toString( getLabel().getIterator()); return s.hashCode(); } return 0; } protected  Axis(String label); boolean isVisible(); void setVisible(boolean flag); AttributedString getLabel(); void setLabel(AttributedString label); void setLabel(String label); AttributedString createLabel(String label); Font getLabelFont(); void setLabelFont(Font font); Paint getLabelPaint(); void setLabelPaint(Paint paint); RectangleInsets getLabelInsets(); void setLabelInsets(RectangleInsets insets); void setLabelInsets(RectangleInsets insets, boolean notify); double getLabelAngle(); void setLabelAngle(double angle); AxisLabelLocation getLabelLocation(); void setLabelLocation(AxisLabelLocation location); boolean isAxisLineVisible(); void setAxisLineVisible(boolean visible); Paint getAxisLinePaint(); void setAxisLinePaint(Paint paint); Stroke getAxisLineStroke(); void setAxisLineStroke(Stroke stroke); boolean isTickLabelsVisible(); void setTickLabelsVisible(boolean flag); boolean isMinorTickMarksVisible(); void setMinorTickMarksVisible(boolean flag); Font getTickLabelFont(); void setTickLabelFont(Font font); Paint getTickLabelPaint(); void setTickLabelPaint(Paint paint); RectangleInsets getTickLabelInsets(); void setTickLabelInsets(RectangleInsets insets); boolean isTickMarksVisible(); void setTickMarksVisible(boolean flag); float getTickMarkInsideLength(); void setTickMarkInsideLength(float length); float getTickMarkOutsideLength(); void setTickMarkOutsideLength(float length); Stroke getTickMarkStroke(); void setTickMarkStroke(Stroke stroke); Paint getTickMarkPaint(); void setTickMarkPaint(Paint paint); float getMinorTickMarkInsideLength(); void setMinorTickMarkInsideLength(float length); float getMinorTickMarkOutsideLength(); void setMinorTickMarkOutsideLength(float length); Plot getPlot(); void setPlot(Plot plot); double getFixedDimension(); void setFixedDimension(double dimension); abstract void configure(); abstract AxisSpace reserveSpace(Graphics2D g2, Plot plot,
            Rectangle2D plotArea, RectangleEdge edge, AxisSpace space); abstract AxisState draw(Graphics2D g2, double cursor,
            Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState); abstract List<? extends Tick> refreshTicks(Graphics2D g2, 
            AxisState state, Rectangle2D dataArea, RectangleEdge edge); void addChangeListener(AxisChangeListener listener); void removeChangeListener(AxisChangeListener listener); boolean hasListener(EventListener listener); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); static final boolean DEFAULT_AXIS_VISIBLE; static final Font DEFAULT_AXIS_LABEL_FONT; static final Paint DEFAULT_AXIS_LABEL_PAINT; static final RectangleInsets DEFAULT_AXIS_LABEL_INSETS; static final Paint DEFAULT_AXIS_LINE_PAINT; static final Stroke DEFAULT_AXIS_LINE_STROKE; static final boolean DEFAULT_TICK_LABELS_VISIBLE; static final Font DEFAULT_TICK_LABEL_FONT; static final Paint DEFAULT_TICK_LABEL_PAINT; static final RectangleInsets DEFAULT_TICK_LABEL_INSETS; static final boolean DEFAULT_TICK_MARKS_VISIBLE; static final Stroke DEFAULT_TICK_MARK_STROKE; static final Paint DEFAULT_TICK_MARK_PAINT; static final float DEFAULT_TICK_MARK_INSIDE_LENGTH; static final float DEFAULT_TICK_MARK_OUTSIDE_LENGTH; }### Answer:
@Test public void testHashCode() { Axis a1 = new CategoryAxis("Test"); Axis a2 = new CategoryAxis("Test"); assertEquals(a1, a2); int h1 = a1.hashCode(); int h2 = a2.hashCode(); assertEquals(h1, h2); }