@Test public void testEquals() { Tag t1 = null; Tag t2 = null; assertEquals(t1, t2); t1 = new Tag("tag1"); assertNotEquals(t1, t2); t2 = new Tag("tag2"); assertNotEquals(t1, t2); t2.setName(t1.getName()); assertEquals(t1, t2); }
@Override public boolean equals(Object obj) { if (!(obj instanceof Tag)) { return false; } Tag other = (Tag)obj; return Utils.objectEquals(this.name, other.name); }
Tag implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Tag)) { return false; } Tag other = (Tag)obj; return Utils.objectEquals(this.name, other.name); } }
Tag implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Tag)) { return false; } Tag other = (Tag)obj; return Utils.objectEquals(this.name, other.name); } Tag(String name); }
Tag implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Tag)) { return false; } Tag other = (Tag)obj; return Utils.objectEquals(this.name, other.name); } Tag(String name); String getName(); void setName(String name); @Override boolean equals(Object obj); }
Tag implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Tag)) { return false; } Tag other = (Tag)obj; return Utils.objectEquals(this.name, other.name); } Tag(String name); String getName(); void setName(String name); @Override boolean equals(Object obj);  }