ConfigurationFolder { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ConfigurationFolder other = (ConfigurationFolder) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.name, other.name) && Objects.equals(this.path, other.path); } ConfigurationFolder();  ConfigurationFolder(final String id, final String name, final String path); String getId(); void setId(final String id); String getName(); void setName(final String name); String getPath(); void setPath(final String path); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() throws Exception { ConfigurationFolder folder = new ConfigurationFolder("id", "name", "path"); ConfigurationFolder folder2 = new ConfigurationFolder("id", "name", "path"); ConfigurationFolder folder3 = new ConfigurationFolder("id3", "name", "path"); ConfigurationFolder folder4 = new ConfigurationFolder("id", "name1", "path"); ConfigurationFolder folder5 = new ConfigurationFolder("id", "name", "path1"); assertEquals(folder, folder); assertEquals(folder, folder2); assertNotEquals(folder, null); assertNotEquals(folder, "folder"); assertNotEquals(folder, folder3); assertNotEquals(folder, folder4); assertNotEquals(folder, folder5); }