@Test public void testEquals() throws Exception { List<CapabilityType> capabilityTypes = new ArrayList<>(); ExportKey exportKey = getKey(Version.Version4, null, capabilityTypes); assertTrue(exportKey.equals(getKey(Version.Version4, null, new ArrayList<CapabilityType>()))); assertTrue(exportKey.equals(exportKey)); assertFalse(exportKey.equals(null)); assertFalse(exportKey.equals(new String())); assertFalse(exportKey.equals(getKey(Version.Version3, null, new ArrayList<CapabilityType>()))); assertFalse(exportKey.equals(getKey(Version.Version4, "wad", new ArrayList<CapabilityType>()))); capabilityTypes.add(CapabilityType.Ipv4Unicast); capabilityTypes.add(CapabilityType.Ipv6Unicast); assertFalse(exportKey.equals(getKey(Version.Version4, null, new ArrayList<CapabilityType>()))); List<CapabilityType> capabilityTypes_ = new ArrayList<>(); capabilityTypes_.add(CapabilityType.Ipv6Unicast); capabilityTypes_.add(CapabilityType.Ipv4Unicast); assertTrue(exportKey.equals(getKey(Version.Version4, null, capabilityTypes_))); assertEquals(exportKey.hashCode(), getKey(Version.Version4, null, capabilityTypes_).hashCode()); capabilityTypes_.add(CapabilityType.LoopDetection); assertNotEquals(exportKey.hashCode(), getKey(Version.Version4, null, capabilityTypes_).hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExportKey exportKey = (ExportKey) o; return Objects.equals(version, exportKey.version) && Objects.equals(groupName, exportKey.groupName) && capabilityTypes.containsAll(exportKey.capabilityTypes) && exportKey.capabilityTypes.containsAll( capabilityTypes); }
ExportKey { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExportKey exportKey = (ExportKey) o; return Objects.equals(version, exportKey.version) && Objects.equals(groupName, exportKey.groupName) && capabilityTypes.containsAll(exportKey.capabilityTypes) && exportKey.capabilityTypes.containsAll( capabilityTypes); } }
ExportKey { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExportKey exportKey = (ExportKey) o; return Objects.equals(version, exportKey.version) && Objects.equals(groupName, exportKey.groupName) && capabilityTypes.containsAll(exportKey.capabilityTypes) && exportKey.capabilityTypes.containsAll( capabilityTypes); } ExportKey(SxpConnection connection); }
ExportKey { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExportKey exportKey = (ExportKey) o; return Objects.equals(version, exportKey.version) && Objects.equals(groupName, exportKey.groupName) && capabilityTypes.containsAll(exportKey.capabilityTypes) && exportKey.capabilityTypes.containsAll( capabilityTypes); } ExportKey(SxpConnection connection); @Override boolean equals(Object o); @Override int hashCode(); }
ExportKey { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExportKey exportKey = (ExportKey) o; return Objects.equals(version, exportKey.version) && Objects.equals(groupName, exportKey.groupName) && capabilityTypes.containsAll(exportKey.capabilityTypes) && exportKey.capabilityTypes.containsAll( capabilityTypes); } ExportKey(SxpConnection connection); @Override boolean equals(Object o); @Override int hashCode();  }