test_class.declarator: configConsumer = new TestConsumer()
test_class.modifier: private final
test_class.original_string: private final TestConsumer configConsumer = new TestConsumer();
test_class.type: TestConsumer
test_class.var_name: configConsumer
test_class.declarator: operConsumer = new TestConsumer()
test_class.modifier: private final
test_class.original_string: private final TestConsumer operConsumer = new TestConsumer();
test_class.type: TestConsumer
test_class.var_name: operConsumer
test_class.declarator: consumers = ImmutableMap
              .of(CONFIGURATION_PREFIX, configConsumer, OPERATIONAL_PREFIX, operConsumer)
test_class.modifier: private final
test_class.original_string: private final Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> consumers = ImmutableMap
              .of(CONFIGURATION_PREFIX, configConsumer, OPERATIONAL_PREFIX, operConsumer);
test_class.type: Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>>
test_class.var_name: consumers
test_class.file: ds/src/test/java/org/opendaylight/etcd/ds/impl/EtcdWatcherSplittingConsumerTest.java
test_class.identifier: EtcdWatcherSplittingConsumerTest
test_case.body: @Test
      public void testEmpty() throws EtcdException {
          EtcdWatcherSplittingConsumer splitter = new EtcdWatcherSplittingConsumer(empty(), consumers);
          splitter.accept(1L, Collections.emptyList());
          assertThat(configConsumer.counter.get()).isEqualTo(0L);
          assertThat(operConsumer.counter.get()).isEqualTo(0L);
      }
test_case.class_method_signature: EtcdWatcherSplittingConsumerTest.testEmpty()
test_case.full_signature: @Test public void testEmpty()
test_case.identifier: testEmpty
test_case.invocations: empty accept emptyList isEqualTo assertThat get isEqualTo assertThat get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmpty()
focal_class.declarator: revAwaiter
focal_class.modifier: private final
focal_class.original_string: private final Optional<RevAwaiter> revAwaiter;
focal_class.type: Optional<RevAwaiter>
focal_class.var_name: revAwaiter
focal_class.declarator: splitConsumers
focal_class.modifier: private final
focal_class.original_string: private final ImmutableMap<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> splitConsumers;
focal_class.type: ImmutableMap<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>>
focal_class.var_name: splitConsumers
focal_class.file: ds/src/main/java/org/opendaylight/etcd/ds/impl/EtcdWatcherSplittingConsumer.java
focal_class.identifier: EtcdWatcherSplittingConsumer
focal_class.interfaces: implements CheckedBiConsumer<Long, List<WatchEvent>, EtcdException>
focal_class.class_method_signature: EtcdWatcherSplittingConsumer.EtcdWatcherSplittingConsumer(Optional<RevAwaiter> revAwaiter,
              Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> splitConsumers)
focal_class.full_signature:   EtcdWatcherSplittingConsumer(Optional<RevAwaiter> revAwaiter,
              Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> splitConsumers)
focal_class.identifier: EtcdWatcherSplittingConsumer
focal_class.parameters: (Optional<RevAwaiter> revAwaiter,
              Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> splitConsumers)
focal_class.signature:  EtcdWatcherSplittingConsumer(Optional<RevAwaiter> revAwaiter,
              Map<ByteSequence, CheckedConsumer<List<WatchEvent>, EtcdException>> splitConsumers)
focal_class.class_method_signature: EtcdWatcherSplittingConsumer.accept(Long revision, List<WatchEvent> allWatchEvents)
focal_class.full_signature: @Override public void accept(Long revision, List<WatchEvent> allWatchEvents)
focal_class.identifier: accept
focal_class.modifiers: @Override public
focal_class.parameters: (Long revision, List<WatchEvent> allWatchEvents)
focal_class.return: void
focal_class.signature: void accept(Long revision, List<WatchEvent> allWatchEvents)
focal_method.body: @Override
      public void accept(Long revision, List<WatchEvent> allWatchEvents) throws EtcdException {
          Builder<ByteSequence, List<WatchEvent>> listsBuilder = builderWithExpectedSize(splitConsumers.size());
          ImmutableSet<ByteSequence> prefixes = splitConsumers.keySet();
          for (ByteSequence keyPrefix : prefixes) {
              listsBuilder.put(keyPrefix, new ArrayList<WatchEvent>());
          }
          ImmutableMap<ByteSequence, List<WatchEvent>> lists = listsBuilder.build();
  
          for (WatchEvent watchEvent : allWatchEvents) {
              for (ByteSequence keyPrefix : prefixes) {
                  if (watchEvent.getKeyValue().getKey().startsWith(keyPrefix)) {
                      lists.get(keyPrefix).add(watchEvent);
                  }
              }
          }
  
          for (Map.Entry<ByteSequence, List<WatchEvent>> list: lists.entrySet()) {
              List<WatchEvent> eventsList = list.getValue();
              // Important optimization, because with separate Oper/Config, one or the other is typically empty
              if (!eventsList.isEmpty()) {
                  splitConsumers.get(list.getKey()).accept(eventsList);
              }
          }
  
          revAwaiter.ifPresent(revAwait -> revAwait.update(revision));
      }
focal_method.class_method_signature: EtcdWatcherSplittingConsumer.accept(Long revision, List<WatchEvent> allWatchEvents)
focal_method.full_signature: @Override public void accept(Long revision, List<WatchEvent> allWatchEvents)
focal_method.identifier: accept
focal_method.invocations: builderWithExpectedSize size keySet put build startsWith getKey getKeyValue add get entrySet getValue isEmpty accept get getKey ifPresent update
focal_method.modifiers: @Override public
focal_method.parameters: (Long revision, List<WatchEvent> allWatchEvents)
focal_method.return: void
focal_method.signature: void accept(Long revision, List<WatchEvent> allWatchEvents)