void (@NotNull Collection<Consent> confirmedByUser) { List<ConfirmedConsent> result; if (confirmedByUser.isEmpty()) { result = Collections.emptyList(); } else { List<ConfirmedConsent> list = new ArrayList<>(confirmedByUser.size()); for (Consent t : confirmedByUser) { list.add(new ConfirmedConsent(t.getId(), t.getVersion(), t.isAccepted(), 0L)); if (!myPluginCodes.isEmpty()) { final String idPrefix = getProductConsentKind(myProductCode, t.getId()); if (idPrefix != null && PER_PRODUCT_CONSENTS.contains(idPrefix)) { for (String pluginCode : myPluginCodes) { list.add(new ConfirmedConsent(idPrefix + "." + pluginCode, t.getVersion(), t.isAccepted(), 0L)); } } } } result = list; } saveConfirmedConsents(result); }