@Test public void testEquality() { DefaultVirtualDevice device1 = new DefaultVirtualDevice(NetworkId.networkId(0), DeviceId.deviceId(deviceIdValue1)); DefaultVirtualDevice device2 = new DefaultVirtualDevice(NetworkId.networkId(0), DeviceId.deviceId(deviceIdValue2)); Port portA = new DefaultPort(device1, PortNumber.portNumber(1), true); Port portB = new DefaultPort(device1, PortNumber.portNumber(2), true); Port portC = new DefaultPort(device2, PortNumber.portNumber(2), true); DefaultVirtualPort port1 = new DefaultVirtualPort(NetworkId.networkId(0), device1, PortNumber.portNumber(1), portA); DefaultVirtualPort port2 = new DefaultVirtualPort(NetworkId.networkId(0), device1, PortNumber.portNumber(1), portA); DefaultVirtualPort port3 = new DefaultVirtualPort(NetworkId.networkId(0), device1, PortNumber.portNumber(2), portB); DefaultVirtualPort port4 = new DefaultVirtualPort(NetworkId.networkId(1), device2, PortNumber.portNumber(2), portC); new EqualsTester().addEqualityGroup(port1, port2).addEqualityGroup(port3) .addEqualityGroup(port4).testEquals(); }
public NetworkId networkId() { return networkId; }
DefaultVirtualPort extends DefaultPort implements VirtualPort { public NetworkId networkId() { return networkId; } }
DefaultVirtualPort extends DefaultPort implements VirtualPort { public NetworkId networkId() { return networkId; } DefaultVirtualPort(NetworkId networkId, Device device, PortNumber portNumber, Port realizedBy); }
DefaultVirtualPort extends DefaultPort implements VirtualPort { public NetworkId networkId() { return networkId; } DefaultVirtualPort(NetworkId networkId, Device device, PortNumber portNumber, Port realizedBy); NetworkId networkId(); @Override Port realizedBy(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DefaultVirtualPort extends DefaultPort implements VirtualPort { public NetworkId networkId() { return networkId; } DefaultVirtualPort(NetworkId networkId, Device device, PortNumber portNumber, Port realizedBy); NetworkId networkId(); @Override Port realizedBy(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }