    @Test
    @SuppressWarnings({"unchecked"})

    void testCreateSnapshot_AggregateMarkedDeletedWillNotGenerateSnapshot() {
        String aggregateIdentifier = UUID.randomUUID().toString();
        DomainEventMessage firstEvent = new GenericDomainEventMessage<>("type", aggregateIdentifier, (long) 0,
                                                                        "Mock contents", MetaData.emptyInstance());
        DomainEventMessage secondEvent = new GenericDomainEventMessage<>("type", aggregateIdentifier, (long) 0,
                                                                         "deleted", MetaData.emptyInstance());
        DomainEventStream eventStream = DomainEventStream.of(firstEvent, secondEvent);
        StubAggregate aggregate = new StubAggregate(aggregateIdentifier);
        when(mockAggregateFactory.createAggregateRoot(aggregateIdentifier, firstEvent)).thenReturn(aggregate);

        DomainEventMessage snapshot = testSubject.createSnapshot(StubAggregate.class,
                                                                 aggregateIdentifier, eventStream);

        verify(mockAggregateFactory).createAggregateRoot(aggregateIdentifier, firstEvent);
        assertNull(snapshot, "Snapshotter shouldn't have created snapshot of deleted aggregate");
    }