DefaultExtensionAuthor implements ExtensionAuthor { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ExtensionAuthor) { ExtensionAuthor otherAuthor = (ExtensionAuthor) obj; return StringUtils.equals(this.name, otherAuthor.getName()) && Objects.equals(getURLString(), otherAuthor.getURLString()); } else { return false; } } DefaultExtensionAuthor(String name, URL url);  DefaultExtensionAuthor(String name, String url); @Override String getName(); @Override URL getURL(); @Override String getURLString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test void equals() { assertEquals(new DefaultExtensionAuthor("name", "url"), new DefaultExtensionAuthor("name", "url")); assertNotEquals(new DefaultExtensionAuthor("name", "url"), new DefaultExtensionAuthor("name2", "url")); assertNotEquals(new DefaultExtensionAuthor("name", "url"), new DefaultExtensionAuthor("name", "url2")); }