void (@NotNull Configuration configuration) { configuration = configuration.copy(); if (configuration.getCreated() <= 0) { configuration.setCreated(System.currentTimeMillis()); } final var searchTemplate = configuration.getMatchOptions().getSearchPattern(); configuration.setName(searchTemplate.length() < RECENT_CONFIGURATION_NAME_LENGTH ? searchTemplate : searchTemplate.substring(0, RECENT_CONFIGURATION_NAME_LENGTH).trim() + "…"); final Configuration old = findConfiguration(historyConfigurations, configuration); if (old != null) historyConfigurations.remove(old); // move to most recent historyConfigurations.add(0, configuration); while (historyConfigurations.size() > MAX_RECENT_SIZE) { historyConfigurations.remove(historyConfigurations.size() - 1); } }