void (@NotNull Update update) { Map<Update, Update> updates = myScheduledUpdates.cacheOrGet(update.getPriority(), new LinkedHashMap<>()); Update existing = updates.remove(update); if (existing != null && existing != update) { existing.setProcessed(); existing.setRejected(); } updates.put(update, update); }