docs: private int insertFromBlockingEvent(final Collection<UUID> allEntitlementUUIDs, final BlockingState currentBlockingState, final List<SubscriptionEvent> inputExistingEvents, final SupportForOlderVersionThan_0_17_X backwardCompatibleContext, final InternalTenantContext internalTenantContext, final Collection<SubscriptionEvent> outputNewEvents) {
          // Keep the current state per entitlement
          final Map<UUID, TargetState> targetStates = new HashMap<UUID, TargetState>();
          for (final UUID cur : allEntitlementUUIDs) {
              targetStates.put(cur, new TargetState());
          }
  
          //
          // Find out where to insert next event, and calculate current state for each entitlement at the position where we stop.
          //
          int index = -1;
          final Iterator<SubscriptionEvent> it = inputExistingEvents.iterator();
          // Where we need to insert in that stream
          DefaultSubscriptionEvent curInsertion = null;
          while (it.hasNext()) {
              final DefaultSubscriptionEvent cur = (DefaultSubscriptionEvent) it.next();
              final int compEffectiveDate = currentBlockingState.getEffectiveDate().compareTo(cur.getEffectiveDateTime());
  
              final boolean shouldContinue;
              switch (compEffectiveDate) {
                  case -1:
                      shouldContinue = false;
                      break;
                  case 0:
                      shouldContinue = compareBlockingStateWithNextSubscriptionEvent(currentBlockingState, cur) > 0;
                      break;
                  case 1:
                      shouldContinue = true;
                      break;
                  default:
                      // Make compiler happy
                      throw new IllegalStateException("Cannot reach statement");
              }
              if (!shouldContinue) {
                  break;
              }
              index++;
  
              final TargetState curTargetState = targetStates.get(cur.getEntitlementId());
              switch (cur.getSubscriptionEventType()) {
                  case START_ENTITLEMENT:
                      curTargetState.setEntitlementStarted();
                      break;
                  case STOP_ENTITLEMENT:
                      curTargetState.setEntitlementStopped();
                      break;
                  case START_BILLING:
                      // For older subscriptions we miss the START_ENTITLEMENT (the START_BILLING marks both start of billing and entitlement)
                      if (backwardCompatibleContext.isOlderEntitlement(cur.getEntitlementId())) {
                          curTargetState.setEntitlementStarted();
                      }
                      curTargetState.setBillingStarted();
                      break;
                  case PAUSE_BILLING:
                  case PAUSE_ENTITLEMENT:
                  case RESUME_ENTITLEMENT:
                  case RESUME_BILLING:
                  case SERVICE_STATE_CHANGE:
                      curTargetState.addEntitlementEvent(cur);
                      break;
                  case STOP_BILLING:
                      curTargetState.setBillingStopped();
                      break;
              }
              curInsertion = cur;
          }
  
          // Extract the list of targets based on the type of blocking state
          final List<UUID> targetEntitlementIds = currentBlockingState.getType() == BlockingStateType.SUBSCRIPTION ? ImmutableList.<UUID>of(currentBlockingState.getBlockedId()) :
                                                  ImmutableList.<UUID>copyOf(allEntitlementUUIDs);
  
          // For each target compute the new events that should be inserted in the stream
          for (final UUID targetEntitlementId : targetEntitlementIds) {
              final SubscriptionEvent[] prevNext = findPrevNext(inputExistingEvents, targetEntitlementId, curInsertion);
              final TargetState curTargetState = targetStates.get(targetEntitlementId);
  
              final List<SubscriptionEventType> eventTypes = curTargetState.addStateAndReturnEventTypes(currentBlockingState);
              for (final SubscriptionEventType t : eventTypes) {
                  outputNewEvents.add(toSubscriptionEvent(prevNext[0], prevNext[1], targetEntitlementId, currentBlockingState, t, internalTenantContext));
              }
          }
  
          return index;
      }