Document implements Serializable { @Override public int hashCode() { int result = included.hashCode(); result = 31 * result + errors.hashCode(); result = 31 * result + (meta != null ? meta.hashCode() : 0); result = 31 * result + (links != null ? links.hashCode() : 0); result = 31 * result + (jsonApi != null ? jsonApi.hashCode() : 0); return result; } Document();  Document(Document document); @Deprecated boolean include(Resource resource); @Deprecated boolean exclude(Resource resource); boolean addInclude(Resource resource); Collection<Resource> getIncluded(); @SuppressWarnings({"SuspiciousMethodCalls", "unchecked"}) T find(ResourceIdentifier resourceIdentifier); T find(String type, String id); @Deprecated boolean errors(List<Error> errors); @Deprecated List<Error> errors(); boolean addError(Error error); boolean setErrors(Collection<Error> errors); List<Error> getErrors(); boolean hasError(); JsonBuffer getMeta(); void setMeta(JsonBuffer meta); JsonBuffer getLinks(); void setLinks(JsonBuffer links); JsonBuffer getJsonApi(); void setJsonApi(JsonBuffer jsonApi); @SuppressWarnings("unchecked") ArrayDocument<DATA> asArrayDocument(); ObjectDocument<DATA> asObjectDocument(); @SuppressWarnings("unchecked") ObjectDocument<DATA> asObjectDocument(int position); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void equality() throws Exception { Document document1 = getDocumentAdapter(Article.class) .fromJson(TestUtil.fromResource("/multiple_compound.json")); Document document2 = getDocumentAdapter(Resource.class, Article.class) .fromJson(TestUtil.fromResource("/multiple_compound.json")); assertEquals(document1, document2); assertEquals(document1.hashCode(), document2.hashCode()); }