### Question:
StandardRevisableEntityService implements RevisableEntityService { @Override public <T extends RevisableEntity> T delete(final String entityIdentifier, final RevisionInfo revisionInfo, final Supplier<T> deleteEntity) { if (entityIdentifier == null || entityIdentifier.trim().isEmpty()) { throw new IllegalArgumentException("Entity identifier is required"); } if (revisionInfo == null || revisionInfo.getVersion() == null) { throw new IllegalArgumentException("Revision info is required"); } final Revision revision = createRevision(entityIdentifier, revisionInfo); final RevisionClaim claim = new StandardRevisionClaim(revision); return revisionManager.deleteRevision(claim, () -> deleteEntity.get()); } StandardRevisableEntityService(final RevisionManager revisionManager); @Override T create(final T requestEntity, final String creatorIdentity, final Supplier<T> createEntity); @Override T get(final Supplier<T> getEntity); @Override List<T> getEntities(final Supplier<List<T>> getEntities); @Override T update(final T requestEntity, final String updaterIdentity, final Supplier<T> updateEntity); @Override T delete(final String entityIdentifier, final RevisionInfo revisionInfo, final Supplier<T> deleteEntity); @Override void populateRevisions(final Collection<?> entities);  }### Answer:
@Test public void testDelete() { final RevisionInfo revisionInfo = new RevisionInfo(null, 0L); final TestEntity requestEntity = new TestEntity("1", revisionInfo); final RevisableEntity createdEntity = entityService.create( requestEntity, "user1", () -> requestEntity); assertNotNull(createdEntity); final RevisableEntity deletedEntity = entityService.delete( createdEntity.getIdentifier(), createdEntity.getRevision(), () -> createdEntity); assertNotNull(deletedEntity); }
@Test(expected = InvalidRevisionException.class) public void testDeleteWhenDoesNotExist() { final RevisionInfo revisionInfo = new RevisionInfo(null, 1L); final RevisableEntity deletedEntity = entityService.delete("1", revisionInfo, () -> null); assertNull(deletedEntity); }