code: private List<Event> toEvents(Collection<Item> items) {
          if (items.isEmpty()) {
              return ImmutableList.of();
          }
  
          // Sort the items to match the order of their events in an attempt to get first-in-first-out.
          return items.stream().sorted().map(Item::toEvent).collect(Collectors.toList());
      }
docs: Converts a collection of Items to Events.