### Question:
DefaultEventStore implements EventStore, Initializable { @Override public CompletableFuture<Optional<Event>> deleteEvent(String eventId) { CompletableFuture<Optional<Event>> future = null; if (this.legacyStore != null) { future = this.legacyStore.deleteEvent(eventId); } if (this.store != null) { future = this.store.deleteEvent(eventId); } if (future == null) { future = new CompletableFuture<>(); future.completeExceptionally(new EventStreamException(NO_STORE)); } return future; }  @Override void initialize(); @Override CompletableFuture<Event> saveEvent(Event event); @Override CompletableFuture<Event> prefilterEvent(Event event); @Override CompletableFuture<Optional<Event>> deleteEvent(String eventId); @Override CompletableFuture<Optional<Event>> deleteEvent(Event event); @Override CompletableFuture<EventStatus> saveEventStatus(EventStatus status); @Override CompletableFuture<EventStatus> saveMailEntityEvent(EntityEvent event); @Override CompletableFuture<Optional<EventStatus>> deleteEventStatus(EventStatus status); @Override CompletableFuture<Void> deleteEventStatuses(String entityId, Date date); @Override CompletableFuture<Optional<EventStatus>> deleteMailEntityEvent(EntityEvent event); @Override Optional<Event> getEvent(String eventId); @Override EventSearchResult search(EventQuery query); @Override EventSearchResult search(EventQuery query, Set<String> fields);  }### Answer:
@Test void deleteEventByInstance() throws EventStreamException { this.defaultStore.deleteEvent(EVENT); verify(this.store).deleteEvent(EVENT); verify(this.legacyStore).deleteEvent(EVENT); }
@Test void deleteEventById() throws EventStreamException, InterruptedException, ExecutionException { assertFalse(this.defaultStore.deleteEvent("id").get().isPresent()); verify(this.legacyStore).deleteEvent("id"); verify(this.store).deleteEvent("id"); when(this.store.deleteEvent("id")).thenReturn(CompletableFuture.completedFuture(Optional.of(EVENT))); assertSame(EVENT, this.defaultStore.deleteEvent("id").get().get()); verify(this.store, times(2)).deleteEvent("id"); verify(this.legacyStore, times(2)).deleteEvent("id"); }