docs: public ContiguousIntervalUsageInArrear build(final boolean closedInterval) {
          Preconditions.checkState(!isBuilt.get(), "!isBuilt");
          Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) ||
                                   (closedInterval && billingEvents.size() >= 2),
                                   "closedInterval=%s, billingEvents.size()=%s", closedInterval, String.valueOf(billingEvents.size()));
  
          final LocalDate startDate = internalTenantContext.toLocalDate(billingEvents.get(0).getEffectiveDate());
          if (targetDate.isBefore(startDate)) {
              return this;
          }
          final LocalDate endDate = closedInterval ? internalTenantContext.toLocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate()) : targetDate;
  
          if (startDate.compareTo(rawUsageStartDate) >= 0) {
              transitionTimes.add(startDate);
          }
  
          for (int i = 0; i < billingEvents.size(); i++) {
              final BillingEvent billingEvent = billingEvents.get(i);
              final LocalDate transitionStartDate = internalTenantContext.toLocalDate(billingEvent.getEffectiveDate());
              if (i == billingEvents.size() - 1) {
                  addTransitionTimesForBillingEvent(transitionStartDate, endDate, billingEvent.getBillCycleDayLocal());
              } else {
                  final BillingEvent nextBillingEvent = billingEvents.get(i + 1);
                  final LocalDate nextEndDate = internalTenantContext.toLocalDate(nextBillingEvent.getEffectiveDate());
                  addTransitionTimesForBillingEvent(transitionStartDate, nextEndDate, billingEvent.getBillCycleDayLocal());
              }
          }
  
          if (closedInterval &&
              transitionTimes.size() > 0 &&
              endDate.isAfter(transitionTimes.get(transitionTimes.size() - 1))) {
              transitionTimes.add(endDate);
          }
          isBuilt.set(true);
          return this;
      }