### Question:
LabelBlock extends AbstractBlock implements Block, PublicCloneable { @Override public boolean equals(Object obj) { if (!(obj instanceof LabelBlock)) { return false; } LabelBlock that = (LabelBlock) obj; if (!this.text.equals(that.text)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtils.equal(this.paint, that.paint)) { return false; } if (!ObjectUtils.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtils.equal(this.urlText, that.urlText)) { return false; } if (!this.contentAlignmentPoint.equals(that.contentAlignmentPoint)) { return false; } if (!this.textAnchor.equals(that.textAnchor)) { return false; } return super.equals(obj); } LabelBlock(String label);  LabelBlock(String text, Font font);  LabelBlock(String text, Font font, Paint paint); Font getFont(); void setFont(Font font); Paint getPaint(); void setPaint(Paint paint); String getToolTipText(); void setToolTipText(String text); String getURLText(); void setURLText(String text); TextBlockAnchor getContentAlignmentPoint(); void setContentAlignmentPoint(TextBlockAnchor anchor); RectangleAnchor getTextAnchor(); void setTextAnchor(RectangleAnchor anchor); @Override Size2D arrange(Graphics2D g2, RectangleConstraint constraint); @Override void draw(Graphics2D g2, Rectangle2D area); @Override Object draw(Graphics2D g2, Rectangle2D area, Object params); @Override boolean equals(Object obj); @Override Object clone(); static final Paint DEFAULT_PAINT; }### Answer:
@Test public void testEquals() { LabelBlock b1 = new LabelBlock("ABC", new Font("Dialog", Font.PLAIN, 12), Color.RED); LabelBlock b2 = new LabelBlock("ABC", new Font("Dialog", Font.PLAIN, 12), Color.RED); assertEquals(b1, b2); assertEquals(b2, b2); b1 = new LabelBlock("XYZ", new Font("Dialog", Font.PLAIN, 12), Color.RED); assertFalse(b1.equals(b2)); b2 = new LabelBlock("XYZ", new Font("Dialog", Font.PLAIN, 12), Color.RED); assertEquals(b1, b2); b1 = new LabelBlock("XYZ", new Font("Dialog", Font.BOLD, 12), Color.RED); assertFalse(b1.equals(b2)); b2 = new LabelBlock("XYZ", new Font("Dialog", Font.BOLD, 12), Color.RED); assertEquals(b1, b2); b1 = new LabelBlock("XYZ", new Font("Dialog", Font.BOLD, 12), Color.BLUE); assertFalse(b1.equals(b2)); b2 = new LabelBlock("XYZ", new Font("Dialog", Font.BOLD, 12), Color.BLUE); assertEquals(b1, b2); b1.setToolTipText("Tooltip"); assertFalse(b1.equals(b2)); b2.setToolTipText("Tooltip"); assertEquals(b1, b2); b1.setURLText("URL"); assertFalse(b1.equals(b2)); b2.setURLText("URL"); assertEquals(b1, b2); b1.setContentAlignmentPoint(TextBlockAnchor.CENTER_RIGHT); assertFalse(b1.equals(b2)); b2.setContentAlignmentPoint(TextBlockAnchor.CENTER_RIGHT); assertEquals(b1, b2); b1.setTextAnchor(RectangleAnchor.BOTTOM_RIGHT); assertFalse(b1.equals(b2)); b2.setTextAnchor(RectangleAnchor.BOTTOM_RIGHT); assertEquals(b1, b2); }