@Test public void testEquals() { new EqualsTester() .addEqualityGroup(cluster(3, 2, 1, "of:1"), cluster(3, 2, 1, "of:1")) .addEqualityGroup(cluster(3, 2, 1, "of:2"), cluster(3, 2, 1, "of:2")) .addEqualityGroup(cluster(0, 2, 1, "of:1"), cluster(0, 2, 1, "of:1")) .addEqualityGroup(cluster(3, 3, 1, "of:1"), cluster(3, 3, 1, "of:1")) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultTopologyCluster) { final DefaultTopologyCluster other = (DefaultTopologyCluster) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.deviceCount, other.deviceCount) && Objects.equals(this.linkCount, other.linkCount) && Objects.equals(this.root, other.root); } return false; }
DefaultTopologyCluster implements TopologyCluster { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultTopologyCluster) { final DefaultTopologyCluster other = (DefaultTopologyCluster) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.deviceCount, other.deviceCount) && Objects.equals(this.linkCount, other.linkCount) && Objects.equals(this.root, other.root); } return false; } }
DefaultTopologyCluster implements TopologyCluster { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultTopologyCluster) { final DefaultTopologyCluster other = (DefaultTopologyCluster) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.deviceCount, other.deviceCount) && Objects.equals(this.linkCount, other.linkCount) && Objects.equals(this.root, other.root); } return false; } DefaultTopologyCluster(ClusterId id, int deviceCount, int linkCount,
                                  TopologyVertex root); }
DefaultTopologyCluster implements TopologyCluster { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultTopologyCluster) { final DefaultTopologyCluster other = (DefaultTopologyCluster) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.deviceCount, other.deviceCount) && Objects.equals(this.linkCount, other.linkCount) && Objects.equals(this.root, other.root); } return false; } DefaultTopologyCluster(ClusterId id, int deviceCount, int linkCount,
                                  TopologyVertex root); @Override ClusterId id(); @Override int deviceCount(); @Override int linkCount(); @Override TopologyVertex root(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DefaultTopologyCluster implements TopologyCluster { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultTopologyCluster) { final DefaultTopologyCluster other = (DefaultTopologyCluster) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.deviceCount, other.deviceCount) && Objects.equals(this.linkCount, other.linkCount) && Objects.equals(this.root, other.root); } return false; } DefaultTopologyCluster(ClusterId id, int deviceCount, int linkCount,
                                  TopologyVertex root); @Override ClusterId id(); @Override int deviceCount(); @Override int linkCount(); @Override TopologyVertex root(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }