docs: private void build() {
          // nextRecurringDate are computed based on *proposed* items, and not missing items (= proposed - existing). So
          // we need to filter out the dates for which there is no item left otherwsie we may end up in creating too many notification dates
          // and in particular that could lead to an infinite loop.
          for (final UUID subscriptionId : perSubscriptionFutureNotificationDates.keySet()) {
              final SubscriptionFutureNotificationDates tmp = perSubscriptionFutureNotificationDates.get(subscriptionId);
              if (tmp.getRecurringBillingMode() == BillingMode.IN_ADVANCE && !hasItemsForSubscription(subscriptionId, InvoiceItemType.RECURRING)) {
                  tmp.resetNextRecurringDate();
              }
          }
          if (invoice != null && invoice.getInvoiceItems().isEmpty()) {
              invoice = null;
          }
      }