@Test public void testEquals() throws Exception { NetworkConnection ip1 = new NetworkConnection("00:50:56:02:00:2f"); NetworkConnection ip2 = new NetworkConnection("00:50:56:02:00:4f"); NetworkConnection ip3 = new NetworkConnection("00:50:56:02:00:2f"); assertThat(ip1.equals(ip2), is(false)); assertThat(ip1.equals(ip3), is(true)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkConnection other = (NetworkConnection) o; return Objects.equals(this.getMacAddress(), other.getMacAddress()) && Objects.equals(this.getIpAddress(), other.getIpAddress()) && Objects.equals(this.getIsConnected(), other.getIsConnected()) && Objects.equals(this.getNetmask(), other.getNetmask()) && Objects.equals(this.getNetwork(), other.getNetwork()); }
NetworkConnection { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkConnection other = (NetworkConnection) o; return Objects.equals(this.getMacAddress(), other.getMacAddress()) && Objects.equals(this.getIpAddress(), other.getIpAddress()) && Objects.equals(this.getIsConnected(), other.getIsConnected()) && Objects.equals(this.getNetmask(), other.getNetmask()) && Objects.equals(this.getNetwork(), other.getNetwork()); } }
NetworkConnection { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkConnection other = (NetworkConnection) o; return Objects.equals(this.getMacAddress(), other.getMacAddress()) && Objects.equals(this.getIpAddress(), other.getIpAddress()) && Objects.equals(this.getIsConnected(), other.getIsConnected()) && Objects.equals(this.getNetmask(), other.getNetmask()) && Objects.equals(this.getNetwork(), other.getNetwork()); } NetworkConnection();  NetworkConnection(String macAddress); }
NetworkConnection { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkConnection other = (NetworkConnection) o; return Objects.equals(this.getMacAddress(), other.getMacAddress()) && Objects.equals(this.getIpAddress(), other.getIpAddress()) && Objects.equals(this.getIsConnected(), other.getIsConnected()) && Objects.equals(this.getNetmask(), other.getNetmask()) && Objects.equals(this.getNetwork(), other.getNetwork()); } NetworkConnection();  NetworkConnection(String macAddress); String getNetwork(); void setNetwork(String network); String getMacAddress(); void setMacAddress(String macAddress); String getIpAddress(); void setIpAddress(String ipAddress); String getNetmask(); void setNetmask(String netmask); Connected getIsConnected(); void setIsConnected(Connected isConnected); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
NetworkConnection { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NetworkConnection other = (NetworkConnection) o; return Objects.equals(this.getMacAddress(), other.getMacAddress()) && Objects.equals(this.getIpAddress(), other.getIpAddress()) && Objects.equals(this.getIsConnected(), other.getIsConnected()) && Objects.equals(this.getNetmask(), other.getNetmask()) && Objects.equals(this.getNetwork(), other.getNetwork()); } NetworkConnection();  NetworkConnection(String macAddress); String getNetwork(); void setNetwork(String network); String getMacAddress(); void setMacAddress(String macAddress); String getIpAddress(); void setIpAddress(String ipAddress); String getNetmask(); void setNetmask(String netmask); Connected getIsConnected(); void setIsConnected(Connected isConnected); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }