@Override
    public Ticket expand(final String ticketId) throws Throwable {
        val structure = parse(ticketId);
        val service = serviceFactory.createService(structure.ticketElements().get(CompactTicketIndexes.SERVICE.getIndex()));
        val clientId = structure.ticketElements().get(3);
        val scopes = StringUtils.isNotBlank(structure.ticketElements().get(4))
            ? Splitter.on("|").splitToList(structure.ticketElements().get(4))
            : new HashSet<String>();
        val responseType = OAuth20ResponseTypes.values()[Integer.parseInt(structure.ticketElements().get(5))];
        val grantType = OAuth20GrantTypes.values()[Integer.parseInt(structure.ticketElements().get(6))];
        val authentication = expandAuthentication(principalFactory, structure);
        val refreshTokenFactory = (OAuth20RefreshTokenFactory) ticketFactory.getObject().get(getTicketType());
        val accessToken = refreshTokenFactory.create(service, authentication, null, scopes, clientId,
            null, Map.of(), responseType, grantType);
        accessToken.setExpirationPolicy(new FixedInstantExpirationPolicy(structure.expirationTime()));
        accessToken.setCreationTime(DateTimeUtils.zonedDateTimeOf(structure.creationTime()));
        return accessToken;
    }
This is {@link OAuth20RefreshTokenCompactor}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/refreshtoken/OAuth20RefreshTokenCompactor.java