@RepeatedTest(2)
    void verifyDeleteSessionsFor() {
        val principalId = UUID.randomUUID().toString();
        val authentication = CoreAuthenticationTestUtils.getAuthentication(principalId);
        val ticketGrantingTicketToAdd = Stream.generate(() -> {
                val tgtId = new TicketGrantingTicketIdGenerator(10, StringUtils.EMPTY)
                    .getNewTicketId(TicketGrantingTicket.PREFIX);
                return new TicketGrantingTicketImpl(tgtId, authentication, NeverExpiresExpirationPolicy.INSTANCE);
            })
            .limit(5);
        getNewTicketRegistry().addTicket(ticketGrantingTicketToAdd);

        val tickets = getNewTicketRegistry().getSessionsFor(principalId).toList();
        assertEquals(5, tickets.size());

        tickets.forEach(Unchecked.consumer(ticket -> getNewTicketRegistry().deleteTicket(ticket)));
        assertEquals(0, getNewTicketRegistry().getSessionsFor(principalId).count());
    }
This is {@link MongoDbTicketRegistryTests}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-mongo-ticket-registry/src/test/java/org/apereo/cas/ticket/registry/MongoDbTicketRegistryTests.java