@Override
    public Ticket expand(final String ticketId) throws Throwable {
        val structure = parse(ticketId);
        val service = serviceFactory.createService(structure.ticketElements().get(CompactTicketIndexes.SERVICE.getIndex()));
        val userCode = structure.ticketElements().get(3);
        val codeFactory = (OAuth20DeviceTokenFactory) ticketFactory.getObject().get(getTicketType());
        val code = codeFactory.createDeviceCode(service);
        code.setUserCode(StringUtils.trimToNull(userCode));
        code.setExpirationPolicy(new FixedInstantExpirationPolicy(structure.expirationTime()));
        code.setCreationTime(DateTimeUtils.zonedDateTimeOf(structure.creationTime()));
        return code;
    }
This is {@link OAuth20DeviceTokenCompactor}.

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