@Test public void testEquals() { List<IspAnnouncement> prefixList = ImmutableList.of(new IspAnnouncement(Prefix.parse("1.1.1.1/32"))); new EqualsTester() .addEqualityGroup( new IspNodeInfo(42, "n1", prefixList), new IspNodeInfo(42L, "n1", prefixList)) .addEqualityGroup(new IspNodeInfo(42, "other", prefixList)) .addEqualityGroup(new IspNodeInfo(24, "n1", prefixList)) .addEqualityGroup( new IspNodeInfo( 42, "n1", ImmutableList.of(new IspAnnouncement(Prefix.parse("2.2.2.2/32"))))) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof IspNodeInfo)) { return false; } IspNodeInfo that = (IspNodeInfo) o; return _asn == that._asn && _name.equals(that._name) && _additionalAnnouncement.equals(that._additionalAnnouncement) && Objects.equals(_trafficFiltering, that._trafficFiltering); }
IspNodeInfo { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof IspNodeInfo)) { return false; } IspNodeInfo that = (IspNodeInfo) o; return _asn == that._asn && _name.equals(that._name) && _additionalAnnouncement.equals(that._additionalAnnouncement) && Objects.equals(_trafficFiltering, that._trafficFiltering); } }
IspNodeInfo { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof IspNodeInfo)) { return false; } IspNodeInfo that = (IspNodeInfo) o; return _asn == that._asn && _name.equals(that._name) && _additionalAnnouncement.equals(that._additionalAnnouncement) && Objects.equals(_trafficFiltering, that._trafficFiltering); } IspNodeInfo(long asn, String name);  IspNodeInfo(long asn, String name, List<IspAnnouncement> additionalAnnouncements);  IspNodeInfo(
      long asn,
      String name,
      List<IspAnnouncement> additionalAnnouncements,
      @Nullable IspTrafficFiltering trafficFiltering); }
IspNodeInfo { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof IspNodeInfo)) { return false; } IspNodeInfo that = (IspNodeInfo) o; return _asn == that._asn && _name.equals(that._name) && _additionalAnnouncement.equals(that._additionalAnnouncement) && Objects.equals(_trafficFiltering, that._trafficFiltering); } IspNodeInfo(long asn, String name);  IspNodeInfo(long asn, String name, List<IspAnnouncement> additionalAnnouncements);  IspNodeInfo(
      long asn,
      String name,
      List<IspAnnouncement> additionalAnnouncements,
      @Nullable IspTrafficFiltering trafficFiltering); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @JsonProperty(PROP_ASN) long getAsn(); @JsonProperty(PROP_NAME) @Nonnull String getName(); @JsonProperty(PROP_ADDITIONAL_ANNOUNCEMENTS_TO_INTERNET) @Nonnull List<IspAnnouncement> getAdditionalAnnouncements(); @JsonProperty(PROP_TRAFFIC_FILTERING) @Nullable IspTrafficFiltering getIspTrafficFiltering(); }
IspNodeInfo { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof IspNodeInfo)) { return false; } IspNodeInfo that = (IspNodeInfo) o; return _asn == that._asn && _name.equals(that._name) && _additionalAnnouncement.equals(that._additionalAnnouncement) && Objects.equals(_trafficFiltering, that._trafficFiltering); } IspNodeInfo(long asn, String name);  IspNodeInfo(long asn, String name, List<IspAnnouncement> additionalAnnouncements);  IspNodeInfo(
      long asn,
      String name,
      List<IspAnnouncement> additionalAnnouncements,
      @Nullable IspTrafficFiltering trafficFiltering); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @JsonProperty(PROP_ASN) long getAsn(); @JsonProperty(PROP_NAME) @Nonnull String getName(); @JsonProperty(PROP_ADDITIONAL_ANNOUNCEMENTS_TO_INTERNET) @Nonnull List<IspAnnouncement> getAdditionalAnnouncements(); @JsonProperty(PROP_TRAFFIC_FILTERING) @Nullable IspTrafficFiltering getIspTrafficFiltering();  }