@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); VirtualConnection sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); VirtualConnection differentObject = getTestObject(); differentObject.setGUID("Different"); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof VirtualConnection)) { return false; } if (!super.equals(objectToCompare)) { return false; } VirtualConnection that = (VirtualConnection) objectToCompare; return Objects.equals(getEmbeddedConnections(), that.getEmbeddedConnections()); }
VirtualConnection extends Connection { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof VirtualConnection)) { return false; } if (!super.equals(objectToCompare)) { return false; } VirtualConnection that = (VirtualConnection) objectToCompare; return Objects.equals(getEmbeddedConnections(), that.getEmbeddedConnections()); } }
VirtualConnection extends Connection { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof VirtualConnection)) { return false; } if (!super.equals(objectToCompare)) { return false; } VirtualConnection that = (VirtualConnection) objectToCompare; return Objects.equals(getEmbeddedConnections(), that.getEmbeddedConnections()); } VirtualConnection();  VirtualConnection(VirtualConnection templateVirtualConnection); }
VirtualConnection extends Connection { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof VirtualConnection)) { return false; } if (!super.equals(objectToCompare)) { return false; } VirtualConnection that = (VirtualConnection) objectToCompare; return Objects.equals(getEmbeddedConnections(), that.getEmbeddedConnections()); } VirtualConnection();  VirtualConnection(VirtualConnection templateVirtualConnection); static ElementType getVirtualConnectionType(); List<EmbeddedConnection> getEmbeddedConnections(); void setEmbeddedConnections(List<EmbeddedConnection> embeddedConnections); @Override String toString(); @Override boolean equals(Object objectToCompare); }
VirtualConnection extends Connection { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof VirtualConnection)) { return false; } if (!super.equals(objectToCompare)) { return false; } VirtualConnection that = (VirtualConnection) objectToCompare; return Objects.equals(getEmbeddedConnections(), that.getEmbeddedConnections()); } VirtualConnection();  VirtualConnection(VirtualConnection templateVirtualConnection); static ElementType getVirtualConnectionType(); List<EmbeddedConnection> getEmbeddedConnections(); void setEmbeddedConnections(List<EmbeddedConnection> embeddedConnections); @Override String toString(); @Override boolean equals(Object objectToCompare);  }