private void addTicketsToRegistry(final TicketRegistry registry, final int tgtCount, final int stCount) {
        val ticket = new TicketGrantingTicketImpl[]{null};
        IntStream.range(0, tgtCount).forEach(Unchecked.intConsumer(i -> {
            ticket[0] = new TicketGrantingTicketImpl(GENERATOR.getNewTicketId("TGT"), CoreAuthenticationTestUtils.getAuthentication(), TEST_EXP_POLICY);
            registry.addTicket(ticket[0]);
        }));

        if (ticket[0] != null) {
            val testService = RegisteredServiceTestUtils.getService("junit");
            IntStream.range(0, stCount).forEach(Unchecked.intConsumer(i -> registry.addTicket(ticket[0].grantServiceTicket(GENERATOR.getNewTicketId("ST"),
                testService, TEST_EXP_POLICY, false, serviceTicketSessionTrackingPolicy))));
        }
    }
Unit test for {@link TicketRegistryHealthIndicator} class.

@author Marvin S. Addison
@since 3.5.0
core/cas-server-core-monitor/src/test/java/org/apereo/cas/monitor/SessionHealthIndicatorTests.java