public void update(TimelineEvent<E> event, TimelineUpdater timelineUpdater) {
        // GitHub #8577 must update event
        int index = IntStream.range(0, events.size())
                .filter(i -> event.equals(events.get(i)))
                .findFirst().orElse(-1);

        if (index >= 0) {
            events.set(index, event);

            if (timelineUpdater != null) {
                // update UI
                timelineUpdater.update(event);
            }
        }
    }
Updates a given event in the model with UI update.

@param event           event to be added
@param timelineUpdater TimelineUpdater instance to update the event in UI
primefaces/src/main/java/org/primefaces/model/timeline/TimelineModel.java