@Test
public void testSnapshot() {

    // GIVEN: A snapshot is taken
    final AbstractSubscriptions<H, T> underTest = getVennDiagram();
    final SubscriptionsReader snapshot = underTest.snapshot();
    // THEN: snapshot cannot be modified but can be queried
    assertThat(snapshot.getSubscribers(Arrays.asList("1", "2", "3"))).containsExactlyInAnyOrder(ACTOR1, ACTOR2);
    // WHEN: the original mutates
    underTest.subscribe(ACTOR1, singleton("8"));
    underTest.unsubscribe(ACTOR1, singleton("1"));
    underTest.removeSubscriber(ACTOR2);
    assertThat(underTest.subscriberToTopic.size()).isEqualTo(2);
    assertThat(underTest.topicToData.size()).isEqualTo(6);
    // THEN: snapshot should not change
    assertThat(snapshot).isEqualTo(getVennDiagram().snapshot());
    assertThat(snapshot).isNotEqualTo(underTest.snapshot());
}