@Override
    public void remove(final ResourceSet set) {
        if (this.entityManager.contains(set)) {
            this.entityManager.remove(set);
        } else {
            this.entityManager.remove(this.entityManager.merge(set));
        }
    }
This is {@link JpaResourceSetRepository}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth-uma-jpa/src/main/java/org/apereo/cas/uma/ticket/resource/repository/impl/JpaResourceSetRepository.java