code: private void triggerDependencies(final Set<String> matchedList, final ConsumerRecord<String, String> record) {
      final List<KafkaDependencyInstanceContext> deleteList = new LinkedList<>();
      for (final String it : matchedList) {
        final List<KafkaDependencyInstanceContext> possibleAvailableDeps =
            this.depInstances.getDepsByTopicAndEvent(record.topic(), it);
        for (final KafkaDependencyInstanceContext dep : possibleAvailableDeps) {
          dep.getCallback().onSuccess(dep);
          deleteList.add(dep);
        }
        //If dependencies that need to be removed could lead to unsubscribing topics, do the topics rebalance
        if (!this.depInstances.removeList(record.topic(), it, deleteList)) {
          this.subscribedTopics.addAll(this.depInstances.getTopicList());
        }
      }
    }
docs: If the matcher returns true, remove the dependency from collection.