code: private Item createNewItem(@Nullable final LocalDate startDate, @Nullable final LocalDate endDate, @Nullable final UUID targetInvoiceId, final boolean mergeMode) {
          // Find the ADD (build phase) or CANCEL (merge phase) item of this interval
          final Item item = getResultingItem(mergeMode);
          if (item == null || startDate == null || endDate == null || targetInvoiceId == null) {
              return item;
          }
  
          // Prorate (build phase) or repair (merge phase) this item, as needed
          final InvoiceItem proratedInvoiceItem = item.toProratedInvoiceItem(startDate, endDate);
          if (proratedInvoiceItem == null) {
              return null;
          } else {
              // Keep track of the repaired amount for this item
              item.incrementCurrentRepairedAmount(proratedInvoiceItem.getAmount().abs());
              return new Item(proratedInvoiceItem, targetInvoiceId, item.getAction());
          }
      }
docs: Create a new item based on the existing items and new service period
  <p/>
  <ul>
  <li>During the build phase, we only consider ADD items. This happens when for instance an existing item was partially repaired
  and there is a need to create a new item which represents the part left -- that was not repaired.
  <li>During the merge phase, we create new items that are the missing repaired items (CANCEL).
  </ul>
  
  @param startDate start date of the new item to create
  @param endDate   end date of the new item to create
  @param mergeMode mode to consider.
  @return new item for this service period or null