@Test public void testEquals() { BgpConfederation bc = new BgpConfederation(1, ImmutableSet.of(2L)); new EqualsTester() .addEqualityGroup(bc, bc, new BgpConfederation(1, ImmutableSet.of(2L))) .addEqualityGroup(new BgpConfederation(2, ImmutableSet.of(3L))) .addEqualityGroup(new BgpConfederation(1, ImmutableSet.of(3L))) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpConfederation)) { return false; } BgpConfederation that = (BgpConfederation) o; return _id == that._id && _members.equals(that._members); }
BgpConfederation implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpConfederation)) { return false; } BgpConfederation that = (BgpConfederation) o; return _id == that._id && _members.equals(that._members); } }
BgpConfederation implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpConfederation)) { return false; } BgpConfederation that = (BgpConfederation) o; return _id == that._id && _members.equals(that._members); } BgpConfederation(long id, Set<Long> members); }
BgpConfederation implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpConfederation)) { return false; } BgpConfederation that = (BgpConfederation) o; return _id == that._id && _members.equals(that._members); } BgpConfederation(long id, Set<Long> members); @JsonProperty(PROP_ID) long getId(); @Nonnull @JsonProperty(PROP_MEMBERS) SortedSet<Long> getMembers(); @Override boolean equals(Object o); @Override int hashCode(); }
BgpConfederation implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpConfederation)) { return false; } BgpConfederation that = (BgpConfederation) o; return _id == that._id && _members.equals(that._members); } BgpConfederation(long id, Set<Long> members); @JsonProperty(PROP_ID) long getId(); @Nonnull @JsonProperty(PROP_MEMBERS) SortedSet<Long> getMembers(); @Override boolean equals(Object o); @Override int hashCode();  }