@Test public void testContainsEntity() { JsonApiRelationship result = new JsonApiRelationship(relatedList, testLocation); Assert.assertTrue(result.containsEntity(dummy1)); Assert.assertTrue(result.containsEntity(anotherDummyClass)); Assert.assertFalse(result.containsEntity(dummy2)); }
boolean containsEntity(JsonApiIdentifiable entity) { return data.stream() .anyMatch(id -> id.isSame(entity)); }
JsonApiRelationship { boolean containsEntity(JsonApiIdentifiable entity) { return data.stream() .anyMatch(id -> id.isSame(entity)); } }
JsonApiRelationship { boolean containsEntity(JsonApiIdentifiable entity) { return data.stream() .anyMatch(id -> id.isSame(entity)); } JsonApiRelationship(JsonApiIdentifiable entity, URI location);   JsonApiRelationship(Collection<? extends JsonApiIdentifiable> entityCollection, URI location); }
JsonApiRelationship { boolean containsEntity(JsonApiIdentifiable entity) { return data.stream() .anyMatch(id -> id.isSame(entity)); } JsonApiRelationship(JsonApiIdentifiable entity, URI location);   JsonApiRelationship(Collection<? extends JsonApiIdentifiable> entityCollection, URI location); List<JsonApiIdentifiable> getData(); Map<String, URI> getLinks(); @Override boolean equals(Object o); @Override int hashCode(); }
JsonApiRelationship { boolean containsEntity(JsonApiIdentifiable entity) { return data.stream() .anyMatch(id -> id.isSame(entity)); } JsonApiRelationship(JsonApiIdentifiable entity, URI location);   JsonApiRelationship(Collection<? extends JsonApiIdentifiable> entityCollection, URI location); List<JsonApiIdentifiable> getData(); Map<String, URI> getLinks(); @Override boolean equals(Object o); @Override int hashCode();  }