### Question:
CompositeTitle extends Title implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CompositeTitle)) { return false; } CompositeTitle that = (CompositeTitle) obj; if (!this.container.equals(that.container)) { return false; } if (!PaintUtils.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } return super.equals(obj); } CompositeTitle();  CompositeTitle(BlockContainer container); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); BlockContainer getContainer(); void setTitleContainer(BlockContainer container); @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);  }### Answer:
@Test public void testEquals() { CompositeTitle t1 = new CompositeTitle(new BlockContainer()); CompositeTitle t2 = new CompositeTitle(new BlockContainer()); assertEquals(t1, t2); assertEquals(t2, t1); t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertFalse(t1.equals(t2)); t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertEquals(t1, t2); t1.setFrame(new BlockBorder(Color.RED)); assertFalse(t1.equals(t2)); t2.setFrame(new BlockBorder(Color.RED)); assertEquals(t1, t2); t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertFalse(t1.equals(t2)); t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertEquals(t1, t2); t1.getContainer().add(new TextTitle("T1")); assertFalse(t1.equals(t2)); t2.getContainer().add(new TextTitle("T1")); assertEquals(t1, t2); t1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.yellow)); assertFalse(t1.equals(t2)); t2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.yellow)); assertEquals(t1, t2); }