test_class.declarator: ACTOR1 = new MockActorRef("actor1")
test_class.modifier: protected static final
test_class.original_string: protected static final ActorRef ACTOR1 = new MockActorRef("actor1");
test_class.type: ActorRef
test_class.var_name: ACTOR1
test_class.declarator: ACTOR2 = new MockActorRef("actor2")
test_class.modifier: protected static final
test_class.original_string: protected static final ActorRef ACTOR2 = new MockActorRef("actor2");
test_class.type: ActorRef
test_class.var_name: ACTOR2
test_class.declarator: ACTOR3 = new MockActorRef("actor3")
test_class.modifier: protected static final
test_class.original_string: protected static final ActorRef ACTOR3 = new MockActorRef("actor3");
test_class.type: ActorRef
test_class.var_name: ACTOR3
test_class.declarator: ACTOR4 = new MockActorRef("actor4")
test_class.modifier: protected static final
test_class.original_string: protected static final ActorRef ACTOR4 = new MockActorRef("actor4");
test_class.type: ActorRef
test_class.var_name: ACTOR4
test_class.file: services/utils/pubsub/src/test/java/org/eclipse/ditto/services/utils/pubsub/ddata/AbstractSubscriptionsTest.java
test_class.identifier: AbstractSubscriptionsTest
test_case.body: @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());
      }
test_case.class_method_signature: AbstractSubscriptionsTest.testSnapshot()
test_case.full_signature: @Test public void testSnapshot()
test_case.identifier: testSnapshot
test_case.invocations: getVennDiagram snapshot containsExactlyInAnyOrder assertThat getSubscribers asList subscribe singleton unsubscribe singleton removeSubscriber isEqualTo assertThat size isEqualTo assertThat size isEqualTo assertThat snapshot getVennDiagram isNotEqualTo assertThat snapshot
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSnapshot()
focal_class.declarator: subscriberToTopic
focal_class.modifier: protected final
focal_class.original_string: protected final Map<ActorRef, Set<String>> subscriberToTopic;
focal_class.type: Map<ActorRef, Set<String>>
focal_class.var_name: subscriberToTopic
focal_class.declarator: subscriberToFilter
focal_class.modifier: protected final
focal_class.original_string: protected final Map<ActorRef, Predicate<Collection<String>>> subscriberToFilter;
focal_class.type: Map<ActorRef, Predicate<Collection<String>>>
focal_class.var_name: subscriberToFilter
focal_class.declarator: topicToData
focal_class.modifier: protected final
focal_class.original_string: protected final Map<String, TopicData<H>> topicToData;
focal_class.type: Map<String, TopicData<H>>
focal_class.var_name: topicToData
focal_class.file: services/utils/pubsub/src/main/java/org/eclipse/ditto/services/utils/pubsub/ddata/AbstractSubscriptions.java
focal_class.identifier: AbstractSubscriptions
focal_class.interfaces: implements Subscriptions<T>
focal_class.class_method_signature: AbstractSubscriptions.AbstractSubscriptions(
              final Map<ActorRef, Set<String>> subscriberToTopic,
              final Map<ActorRef, Predicate<Collection<String>>> subscriberToFilter,
              final Map<String, TopicData<H>> topicToData)
focal_class.full_signature: protected  AbstractSubscriptions(
              final Map<ActorRef, Set<String>> subscriberToTopic,
              final Map<ActorRef, Predicate<Collection<String>>> subscriberToFilter,
              final Map<String, TopicData<H>> topicToData)
focal_class.identifier: AbstractSubscriptions
focal_class.modifiers: protected
focal_class.parameters: (
              final Map<ActorRef, Set<String>> subscriberToTopic,
              final Map<ActorRef, Predicate<Collection<String>>> subscriberToFilter,
              final Map<String, TopicData<H>> topicToData)
focal_class.signature:  AbstractSubscriptions(
              final Map<ActorRef, Set<String>> subscriberToTopic,
              final Map<ActorRef, Predicate<Collection<String>>> subscriberToFilter,
              final Map<String, TopicData<H>> topicToData)
focal_class.class_method_signature: AbstractSubscriptions.hashTopic(final String topic)
focal_class.full_signature: protected abstract H hashTopic(final String topic)
focal_class.identifier: hashTopic
focal_class.modifiers: protected abstract
focal_class.parameters: (final String topic)
focal_class.return: H
focal_class.signature: H hashTopic(final String topic)
focal_class.class_method_signature: AbstractSubscriptions.onNewTopic(final TopicData<H> newTopic)
focal_class.full_signature: protected abstract void onNewTopic(final TopicData<H> newTopic)
focal_class.identifier: onNewTopic
focal_class.modifiers: protected abstract
focal_class.parameters: (final TopicData<H> newTopic)
focal_class.return: void
focal_class.signature: void onNewTopic(final TopicData<H> newTopic)
focal_class.class_method_signature: AbstractSubscriptions.onRemovedTopic(final TopicData<H> removedTopic)
focal_class.full_signature: protected abstract void onRemovedTopic(final TopicData<H> removedTopic)
focal_class.identifier: onRemovedTopic
focal_class.modifiers: protected abstract
focal_class.parameters: (final TopicData<H> removedTopic)
focal_class.return: void
focal_class.signature: void onRemovedTopic(final TopicData<H> removedTopic)
focal_class.class_method_signature: AbstractSubscriptions.subscribe(final ActorRef subscriber,
              final Set<String> topics,
              final Predicate<Collection<String>> filter)
focal_class.full_signature: @Override public boolean subscribe(final ActorRef subscriber,
              final Set<String> topics,
              final Predicate<Collection<String>> filter)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (final ActorRef subscriber,
              final Set<String> topics,
              final Predicate<Collection<String>> filter)
focal_class.return: boolean
focal_class.signature: boolean subscribe(final ActorRef subscriber,
              final Set<String> topics,
              final Predicate<Collection<String>> filter)
focal_class.class_method_signature: AbstractSubscriptions.unsubscribe(final ActorRef subscriber, final Set<String> topics)
focal_class.full_signature: @Override public boolean unsubscribe(final ActorRef subscriber, final Set<String> topics)
focal_class.identifier: unsubscribe
focal_class.modifiers: @Override public
focal_class.parameters: (final ActorRef subscriber, final Set<String> topics)
focal_class.return: boolean
focal_class.signature: boolean unsubscribe(final ActorRef subscriber, final Set<String> topics)
focal_class.class_method_signature: AbstractSubscriptions.removeSubscriber(final ActorRef subscriber)
focal_class.full_signature: @Override public boolean removeSubscriber(final ActorRef subscriber)
focal_class.identifier: removeSubscriber
focal_class.modifiers: @Override public
focal_class.parameters: (final ActorRef subscriber)
focal_class.return: boolean
focal_class.signature: boolean removeSubscriber(final ActorRef subscriber)
focal_class.class_method_signature: AbstractSubscriptions.contains(final ActorRef subscriber)
focal_class.full_signature: @Override public boolean contains(final ActorRef subscriber)
focal_class.identifier: contains
focal_class.modifiers: @Override public
focal_class.parameters: (final ActorRef subscriber)
focal_class.return: boolean
focal_class.signature: boolean contains(final ActorRef subscriber)
focal_class.class_method_signature: AbstractSubscriptions.countTopics()
focal_class.full_signature: @Override public int countTopics()
focal_class.identifier: countTopics
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int countTopics()
focal_class.class_method_signature: AbstractSubscriptions.snapshot()
focal_class.full_signature: @Override public SubscriptionsReader snapshot()
focal_class.identifier: snapshot
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SubscriptionsReader
focal_class.signature: SubscriptionsReader snapshot()
focal_class.class_method_signature: AbstractSubscriptions.exportSubscriberToFilter()
focal_class.full_signature: private Map<ActorRef, Predicate<Collection<String>>> exportSubscriberToFilter()
focal_class.identifier: exportSubscriberToFilter
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<ActorRef, Predicate<Collection<String>>>
focal_class.signature: Map<ActorRef, Predicate<Collection<String>>> exportSubscriberToFilter()
focal_class.class_method_signature: AbstractSubscriptions.exportTopicData()
focal_class.full_signature: private Map<String, Set<ActorRef>> exportTopicData()
focal_class.identifier: exportTopicData
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<String, Set<ActorRef>>
focal_class.signature: Map<String, Set<ActorRef>> exportTopicData()
focal_class.class_method_signature: AbstractSubscriptions.removeSubscriberForTopics(final ActorRef subscriber, final Collection<String> topics)
focal_class.full_signature: private boolean removeSubscriberForTopics(final ActorRef subscriber, final Collection<String> topics)
focal_class.identifier: removeSubscriberForTopics
focal_class.modifiers: private
focal_class.parameters: (final ActorRef subscriber, final Collection<String> topics)
focal_class.return: boolean
focal_class.signature: boolean removeSubscriberForTopics(final ActorRef subscriber, final Collection<String> topics)
focal_class.class_method_signature: AbstractSubscriptions.unionSet(final Set<String> s1, final Set<String> s2)
focal_class.full_signature: private static Set<String> unionSet(final Set<String> s1, final Set<String> s2)
focal_class.identifier: unionSet
focal_class.modifiers: private static
focal_class.parameters: (final Set<String> s1, final Set<String> s2)
focal_class.return: Set<String>
focal_class.signature: Set<String> unionSet(final Set<String> s1, final Set<String> s2)
focal_class.class_method_signature: AbstractSubscriptions.equals(final Object other)
focal_class.full_signature: @Override public boolean equals(final Object other)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (final Object other)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object other)
focal_class.class_method_signature: AbstractSubscriptions.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: @Override
      public SubscriptionsReader snapshot() {
          return SubscriptionsReader.of(exportTopicData(), exportSubscriberToFilter());
      }
focal_method.class_method_signature: AbstractSubscriptions.snapshot()
focal_method.full_signature: @Override public SubscriptionsReader snapshot()
focal_method.identifier: snapshot
focal_method.invocations: of exportTopicData exportSubscriberToFilter
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: SubscriptionsReader
focal_method.signature: SubscriptionsReader snapshot()