@Test public void testEquals() { CategoryMarker m1 = new CategoryMarker("A"); CategoryMarker m2 = new CategoryMarker("A"); assertEquals(m1, m2); assertEquals(m2, m1); m1 = new CategoryMarker("B"); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("B"); assertEquals(m1, m2); m1 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(1.1f)); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(1.1f)); assertEquals(m1, m2); m1 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f)); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f)); assertEquals(m1, m2); m1 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(1.0f), 1.0f); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(1.0f), 1.0f); assertEquals(m1, m2); m1 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(3.3f), 1.0f); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(3.3f), 1.0f); assertEquals(m1, m2); m1 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(1.0f), 0.5f); assertFalse(m1.equals(m2)); m2 = new CategoryMarker("A", new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.yellow), new BasicStroke(2.2f), Color.RED, new BasicStroke(1.0f), 0.5f); assertEquals(m1, m2); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof CategoryMarker)) { return false; } if (!super.equals(obj)) { return false; } CategoryMarker that = (CategoryMarker) obj; if (!this.key.equals(that.key)) { return false; } if (this.drawAsLine != that.drawAsLine) { return false; } return true; }
CategoryMarker extends Marker implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof CategoryMarker)) { return false; } if (!super.equals(obj)) { return false; } CategoryMarker that = (CategoryMarker) obj; if (!this.key.equals(that.key)) { return false; } if (this.drawAsLine != that.drawAsLine) { return false; } return true; } }
CategoryMarker extends Marker implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof CategoryMarker)) { return false; } if (!super.equals(obj)) { return false; } CategoryMarker that = (CategoryMarker) obj; if (!this.key.equals(that.key)) { return false; } if (this.drawAsLine != that.drawAsLine) { return false; } return true; } CategoryMarker(Comparable key);  CategoryMarker(Comparable key, Paint paint, Stroke stroke);  CategoryMarker(Comparable key, Paint paint, Stroke stroke,
                          Paint outlinePaint, Stroke outlineStroke,
                          float alpha); }
CategoryMarker extends Marker implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof CategoryMarker)) { return false; } if (!super.equals(obj)) { return false; } CategoryMarker that = (CategoryMarker) obj; if (!this.key.equals(that.key)) { return false; } if (this.drawAsLine != that.drawAsLine) { return false; } return true; } CategoryMarker(Comparable key);  CategoryMarker(Comparable key, Paint paint, Stroke stroke);  CategoryMarker(Comparable key, Paint paint, Stroke stroke,
                          Paint outlinePaint, Stroke outlineStroke,
                          float alpha); Comparable getKey(); void setKey(Comparable key); boolean getDrawAsLine(); void setDrawAsLine(boolean drawAsLine); @Override boolean equals(Object obj); }
CategoryMarker extends Marker implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof CategoryMarker)) { return false; } if (!super.equals(obj)) { return false; } CategoryMarker that = (CategoryMarker) obj; if (!this.key.equals(that.key)) { return false; } if (this.drawAsLine != that.drawAsLine) { return false; } return true; } CategoryMarker(Comparable key);  CategoryMarker(Comparable key, Paint paint, Stroke stroke);  CategoryMarker(Comparable key, Paint paint, Stroke stroke,
                          Paint outlinePaint, Stroke outlineStroke,
                          float alpha); Comparable getKey(); void setKey(Comparable key); boolean getDrawAsLine(); void setDrawAsLine(boolean drawAsLine); @Override boolean equals(Object obj);  }