@Test public void testHashCodeAndEquals() { Mapping<?> secondMapping = new Mapping<>(this.source, this.metaData, "resource/type"); assertThat(this.testee.hashCode()).isEqualTo(secondMapping.hashCode()); assertThat(this.testee).isEqualTo(secondMapping); secondMapping = new Mapping<>("/other/source", this.metaData, "resource/type"); assertThat(this.testee.hashCode()).isNotEqualTo(secondMapping.hashCode()); assertThat(this.testee).isNotEqualTo(secondMapping); secondMapping = new Mapping<>(this.source, mock(ResourceModelMetaData.class), "resource/type"); assertThat(this.testee.hashCode()).isNotEqualTo(secondMapping.hashCode()); assertThat(this.testee).isNotEqualTo(secondMapping); }
@Override public int hashCode() { return this.hashCode; }
Mapping { @Override public int hashCode() { return this.hashCode; } }
Mapping { @Override public int hashCode() { return this.hashCode; } Mapping(@Nonnull String resourcePath, @Nonnull ResourceModelMetaData metadata, @Nonnull String resourceType); }
Mapping { @Override public int hashCode() { return this.hashCode; } Mapping(@Nonnull String resourcePath, @Nonnull ResourceModelMetaData metadata, @Nonnull String resourceType); @Override String toString(); @Nonnull ResourceModelMetaData getMetadata(); @Nonnull String getResourceType(); @Override boolean equals(Object o); @Override int hashCode(); }
Mapping { @Override public int hashCode() { return this.hashCode; } Mapping(@Nonnull String resourcePath, @Nonnull ResourceModelMetaData metadata, @Nonnull String resourceType); @Override String toString(); @Nonnull ResourceModelMetaData getMetadata(); @Nonnull String getResourceType(); @Override boolean equals(Object o); @Override int hashCode();  }