@DeleteMapping(produces = MediaType.APPLICATION_JSON_VALUE)
            public ResponseEntity delete(
                @RequestParam(required = false)
                final String principal,
                @RequestParam(required = false)
                final Long decisionId) {
                if (StringUtils.isNotBlank(principal)) {
                    if (storage.getRecords().containsKey(principal)) {

                        if (decisionId == null) {
                            storage.getRecords().remove(principal);
                            return ResponseEntity.ok().build();
                        }
                        
                        val decisions = storage.getRecords().get(principal);
                        decisions.removeIf(decision -> decision.getId() == decisionId);
                        return ResponseEntity.ok().build();
                    }
                }
                return ResponseEntity.notFound().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