@Test public void testEquals() { new EqualsTester() .addEqualityGroup( new Layer3Edge( NodeInterfacePair.of("node1", "interface1"), NodeInterfacePair.of("node2", "interface2"), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("1.1.1.1"), 32)), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("2.2.2.2"), 32))), new Layer3Edge( NodeInterfacePair.of("node1", "interface1"), NodeInterfacePair.of("node2", "interface2"), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("1.1.1.1"), 32)), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("2.2.2.2"), 32)))) .addEqualityGroup( new Layer3Edge( NodeInterfacePair.of("diffnode1", "diffinterface1"), NodeInterfacePair.of("diffnode2", "diffinterface2"), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("3.3.3.3"), 32)), ImmutableSortedSet.of(ConcreteInterfaceAddress.create(Ip.parse("4.4.4.4"), 32)))) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Layer3Edge)) { return false; } Layer3Edge that = (Layer3Edge) o; return Objects.equals(_interfaceAddresses1, that._interfaceAddresses1) && Objects.equals(_interfaceAddresses2, that._interfaceAddresses2) && Objects.equals(_nodeInterface1, that._nodeInterface1) && Objects.equals(_nodeInterface2, that._nodeInterface2); }
Layer3Edge implements Comparable<Layer3Edge> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Layer3Edge)) { return false; } Layer3Edge that = (Layer3Edge) o; return Objects.equals(_interfaceAddresses1, that._interfaceAddresses1) && Objects.equals(_interfaceAddresses2, that._interfaceAddresses2) && Objects.equals(_nodeInterface1, that._nodeInterface1) && Objects.equals(_nodeInterface2, that._nodeInterface2); } }
Layer3Edge implements Comparable<Layer3Edge> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Layer3Edge)) { return false; } Layer3Edge that = (Layer3Edge) o; return Objects.equals(_interfaceAddresses1, that._interfaceAddresses1) && Objects.equals(_interfaceAddresses2, that._interfaceAddresses2) && Objects.equals(_nodeInterface1, that._nodeInterface1) && Objects.equals(_nodeInterface2, that._nodeInterface2); } Layer3Edge(
      NodeInterfacePair nodeInterface1,
      NodeInterfacePair nodeInterface2,
      SortedSet<InterfaceAddress> interfaceAddresses1,
      SortedSet<InterfaceAddress> interfaceAddresses2); }
Layer3Edge implements Comparable<Layer3Edge> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Layer3Edge)) { return false; } Layer3Edge that = (Layer3Edge) o; return Objects.equals(_interfaceAddresses1, that._interfaceAddresses1) && Objects.equals(_interfaceAddresses2, that._interfaceAddresses2) && Objects.equals(_nodeInterface1, that._nodeInterface1) && Objects.equals(_nodeInterface2, that._nodeInterface2); } Layer3Edge(
      NodeInterfacePair nodeInterface1,
      NodeInterfacePair nodeInterface2,
      SortedSet<InterfaceAddress> interfaceAddresses1,
      SortedSet<InterfaceAddress> interfaceAddresses2); @Override boolean equals(Object o); @Override int hashCode(); @JsonProperty(PROP_NODE_INTERFACE1) @Nonnull NodeInterfacePair getNodeInterface1(); @JsonProperty(PROP_NODE_INTERFACE2) @Nonnull NodeInterfacePair getNodeInterface2(); @JsonProperty(PROP_INTERFACE_ADDRESSES1) @Nonnull SortedSet<InterfaceAddress> getInterfaceAddresses1(); @JsonProperty(PROP_INTERFACE_ADDRESSES2) @Nonnull SortedSet<InterfaceAddress> getInterfaceAddresses2(); @Override int compareTo(Layer3Edge o); }
Layer3Edge implements Comparable<Layer3Edge> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Layer3Edge)) { return false; } Layer3Edge that = (Layer3Edge) o; return Objects.equals(_interfaceAddresses1, that._interfaceAddresses1) && Objects.equals(_interfaceAddresses2, that._interfaceAddresses2) && Objects.equals(_nodeInterface1, that._nodeInterface1) && Objects.equals(_nodeInterface2, that._nodeInterface2); } Layer3Edge(
      NodeInterfacePair nodeInterface1,
      NodeInterfacePair nodeInterface2,
      SortedSet<InterfaceAddress> interfaceAddresses1,
      SortedSet<InterfaceAddress> interfaceAddresses2); @Override boolean equals(Object o); @Override int hashCode(); @JsonProperty(PROP_NODE_INTERFACE1) @Nonnull NodeInterfacePair getNodeInterface1(); @JsonProperty(PROP_NODE_INTERFACE2) @Nonnull NodeInterfacePair getNodeInterface2(); @JsonProperty(PROP_INTERFACE_ADDRESSES1) @Nonnull SortedSet<InterfaceAddress> getInterfaceAddresses1(); @JsonProperty(PROP_INTERFACE_ADDRESSES2) @Nonnull SortedSet<InterfaceAddress> getInterfaceAddresses2(); @Override int compareTo(Layer3Edge o);  }