@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
            public ResponseEntity store(
                @RequestBody
                final ConsentDecision decision) {
                if (storage.getRecords().containsKey(decision.getPrincipal())) {
                    val decisions = storage.getRecords().get(decision.getPrincipal());
                    decisions.removeIf(consentDecision -> consentDecision.getId() == decision.getId());
                    decisions.add(decision);
                } else {
                    storage.getRecords().put(decision.getPrincipal(), CollectionUtils.wrapList(decision));
                }
                return ResponseEntity.ok().build();
            }
This is {@link RestfulConsentRepositoryTests}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-consent-rest/src/test/java/org/apereo/cas/consent/RestfulConsentRepositoryTests.java