protected OAuth20AccessToken newAccessToken(final TicketGrantingTicket tgt) throws Throwable {
        val code = createOAuthCode();
        val testService = CoreAuthenticationTestUtils.getService("https://service.example.com");
        return defaultAccessTokenFactory.create(testService, tgt.getAuthentication(),
            tgt, new ArrayList<>(), code.getId(), code.getClientId(), new HashMap<>(),
            OAuth20ResponseTypes.CODE, OAuth20GrantTypes.AUTHORIZATION_CODE);
    }
This is {@link BaseOAuth20ExpirationPolicyTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/ticket/BaseOAuth20ExpirationPolicyTests.java