@Test public void hashCodeTests() { final LibraryImportEvent event1 = new LibraryImportEvent("lib", URI.create("file: URI.create("file: final LibraryImportEvent event2 = new LibraryImportEvent("lib", URI.create("file: URI.create("file: final LibraryImportEvent event3 = new LibraryImportEvent("lib", null, URI.create("file: final LibraryImportEvent event4 = new LibraryImportEvent("lib", null, URI.create("file: final LibraryImportEvent event5 = new LibraryImportEvent("lib", URI.create("file: final LibraryImportEvent event6 = new LibraryImportEvent("lib", URI.create("file: final LibraryImportEvent event7 = new LibraryImportEvent("lib", null, null); final LibraryImportEvent event8 = new LibraryImportEvent("lib", null, null); assertThat(event1.hashCode()).isEqualTo(event2.hashCode()); assertThat(event3.hashCode()).isEqualTo(event4.hashCode()); assertThat(event5.hashCode()).isEqualTo(event6.hashCode()); assertThat(event7.hashCode()).isEqualTo(event8.hashCode()); }
@Override public int hashCode() { return Objects.hash(name, importer, source); }
LibraryImportEvent { @Override public int hashCode() { return Objects.hash(name, importer, source); } }
LibraryImportEvent { @Override public int hashCode() { return Objects.hash(name, importer, source); } LibraryImportEvent(final String name, final URI importer, final URI source); }
LibraryImportEvent { @Override public int hashCode() { return Objects.hash(name, importer, source); } LibraryImportEvent(final String name, final URI importer, final URI source); static LibraryImportEvent from(final Map<String, Object> eventMap); String getName(); Optional<URI> getImporter(); Optional<URI> getSource(); @Override boolean equals(final Object obj); @Override int hashCode(); }
LibraryImportEvent { @Override public int hashCode() { return Objects.hash(name, importer, source); } LibraryImportEvent(final String name, final URI importer, final URI source); static LibraryImportEvent from(final Map<String, Object> eventMap); String getName(); Optional<URI> getImporter(); Optional<URI> getSource(); @Override boolean equals(final Object obj); @Override int hashCode();  }