### Question:
DeleteIdentityAction { public void delete(Identity identity) throws PersistenceException { identityRepository.delete(identity); eventSink.push(new IdentityDeletedEvent(identity)); } @Inject  DeleteIdentityAction(IdentityRepository identityRepository, EventSink eventSink); void delete(Identity identity);  }### Answer:
@Test public void deletesIdentity() throws Exception { action.delete(identity); assertFalse(repo.findAll().getIdentities().contains(identity)); List<Event> events = subscriber.getOnNextEvents(); assertThat(events, hasSize(1)); assertThat(events.get(0), instanceOf(IdentityDeletedEvent.class)); }