@Test public void testEquals() { LineBorder b1 = new LineBorder(Color.RED, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); LineBorder b2 = new LineBorder(Color.RED, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); assertEquals(b1, b2); assertEquals(b2, b2); b1 = new LineBorder(Color.BLUE, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); assertFalse(b1.equals(b2)); b2 = new LineBorder(Color.BLUE, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); assertEquals(b1, b2); b1 = new LineBorder(Color.BLUE, new BasicStroke(1.1f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); assertFalse(b1.equals(b2)); b2 = new LineBorder(Color.BLUE, new BasicStroke(1.1f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); assertEquals(b1, b2); b1 = new LineBorder(Color.BLUE, new BasicStroke(1.1f), new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertFalse(b1.equals(b2)); b2 = new LineBorder(Color.BLUE, new BasicStroke(1.1f), new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertEquals(b1, b2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true; }
LineBorder implements BlockFrame, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true; } }
LineBorder implements BlockFrame, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true; } LineBorder();  LineBorder(Paint paint, Stroke stroke, RectangleInsets insets); }
LineBorder implements BlockFrame, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true; } LineBorder();  LineBorder(Paint paint, Stroke stroke, RectangleInsets insets); Paint getPaint(); @Override RectangleInsets getInsets(); Stroke getStroke(); @Override void draw(Graphics2D g2, Rectangle2D area); @Override boolean equals(Object obj); }
LineBorder implements BlockFrame, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof LineBorder)) { return false; } LineBorder that = (LineBorder) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!this.insets.equals(that.insets)) { return false; } return true; } LineBorder();  LineBorder(Paint paint, Stroke stroke, RectangleInsets insets); Paint getPaint(); @Override RectangleInsets getInsets(); Stroke getStroke(); @Override void draw(Graphics2D g2, Rectangle2D area); @Override boolean equals(Object obj);  }