@Test public void testEqualsReturnsTrueForObjectsWithSameValues() { final DomainInfo thisDomainInfo = new DomainInfo(DOMAIN_DISTRIBUTION_AUTOMATION, DOMAIN_VERSION); final DomainInfo otherDomainInfo = new DomainInfo(DOMAIN_DISTRIBUTION_AUTOMATION, DOMAIN_VERSION); final boolean actual = thisDomainInfo.equals(otherDomainInfo); assertThat(actual).isTrue(); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainInfo)) { return false; } final DomainInfo other = (DomainInfo) obj; return Objects.equals(this.domain, other.domain) && Objects.equals(this.domainVersion, other.domainVersion); }
DomainInfo { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainInfo)) { return false; } final DomainInfo other = (DomainInfo) obj; return Objects.equals(this.domain, other.domain) && Objects.equals(this.domainVersion, other.domainVersion); } }
DomainInfo { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainInfo)) { return false; } final DomainInfo other = (DomainInfo) obj; return Objects.equals(this.domain, other.domain) && Objects.equals(this.domainVersion, other.domainVersion); } DomainInfo(final String domain, final String domainVersion); }
DomainInfo { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainInfo)) { return false; } final DomainInfo other = (DomainInfo) obj; return Objects.equals(this.domain, other.domain) && Objects.equals(this.domainVersion, other.domainVersion); } DomainInfo(final String domain, final String domainVersion); String getDomain(); String getDomainVersion(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); }
DomainInfo { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof DomainInfo)) { return false; } final DomainInfo other = (DomainInfo) obj; return Objects.equals(this.domain, other.domain) && Objects.equals(this.domainVersion, other.domainVersion); } DomainInfo(final String domain, final String domainVersion); String getDomain(); String getDomainVersion(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }