Thing extends Resource implements ThingId, UserId, CategoryId, LanguageId { @Override public boolean equals(Object obj) { String pk = getThingId(); if (pk == null || obj == null || !(obj instanceof Thing)) { return false; } return pk.equals(((Thing) obj).getThingId()); } Thing(FlattrObject data); static ThingId withId(final String id); @Override String getThingId(); String getResource(); String getLink(); Date getCreated(); int getClicks(); String getUrl(); String getTitle(); void setTitle(String title); String getImage(); @Override String getUserId(); User getUser(); @Override String getCategoryId(); void setCategory(CategoryId category); String getDescription(); void setDescription(String description); List<String> getTags(); void setTags(List<String> tags); void addTag(String tag); @Override String getLanguageId(); void setLanguage(LanguageId language); boolean isHidden(); void setHidden(boolean hidden); boolean isFlattred(); boolean isSubscribed(); Date getLastFlattr(); Date getUpdated(); void merge(Submission submission); FlattrObject toUpdate(); String getQrPdfUrl(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() throws FlattrException { Thing thing1 = new Thing(new FlattrObject("{\"id\":268185}")); Thing thing2 = new Thing(new FlattrObject("{\"id\":268185}")); Thing thing3 = new Thing(new FlattrObject("{\"id\":335823}")); assertThat(thing1, is(equalTo(thing2))); assertThat(thing2, is(equalTo(thing1))); assertThat(thing1, not(equalTo(thing3))); assertThat(thing3, not(equalTo(thing1))); }