@RepeatedTest(2)
    void verifyAddAndUpdateTicket() throws Throwable {
        val generatedTickets = TestTicketIdentifiers.generate();
        val ticketGrantingTicketId = generatedTickets.ticketGrantingTicketId();
        val tgt = new TicketGrantingTicketImpl(
            ticketGrantingTicketId,
            CoreAuthenticationTestUtils.getAuthentication(),
            NeverExpiresExpirationPolicy.INSTANCE);
        val addedTicket = ticketRegistry.addTicket(tgt);

        await().untilAsserted(() -> assertNotNull(ticketRegistry.getTicket(addedTicket.getId(), TicketGrantingTicket.class)));

        val found = ticketRegistry.getTicket(addedTicket.getId(), TicketGrantingTicket.class);
        assertNotNull(found, () -> "Ticket is null. useEncryption[" + useEncryption + ']');

        assertInstanceOf(TicketGrantingTicket.class, found);
        var services = found.getServices();
        assertTrue(services.isEmpty(), () -> "Ticket services should be empty. useEncryption[" + useEncryption + ']');

        val service = RegisteredServiceTestUtils.getService("TGT_UPDATE_TEST");
        val serviceTicketId = generatedTickets.serviceTicketId();
        val serviceTicket = tgt.grantServiceTicket(serviceTicketId, service,
            NeverExpiresExpirationPolicy.INSTANCE, false, serviceTicketSessionTrackingPolicy);
        assertNotNull(serviceTicket);

        val updatedTgt = ticketRegistry.updateTicket(tgt);
        val tgtResult = updatedTgt.isStateless()
            ? ticketRegistry.getTicket(updatedTgt.getId(), TicketGrantingTicket.class)
            : ticketRegistry.getTicket(tgt.getId(), TicketGrantingTicket.class);
        assertInstanceOf(TicketGrantingTicket.class, tgtResult);
        services = tgtResult.getServices();
        assertEquals(Set.of(serviceTicketId), services.keySet());
    }
Exercise block of code in {@link AbstractTicketRegistry#getTicket(String ticketId)} that runs when
the method encounters a {@link Ticket} created in the future.
Adds 10 seconds to creation time to simulate time out of sync so warning will be logged.
core/cas-server-core-tickets/src/test/java/org/apereo/cas/ticket/registry/BaseTicketRegistryTests.java