@Override public boolean isExpired(final TicketState ticketState) { return ticketState == null || ticketState .getCreationTime() .plus(this.timeToKillInMilliSeconds, ChronoUnit.MILLIS) .isBefore(ZonedDateTime.now(ZoneOffset.UTC)); }
@Override public boolean isExpired(final TicketState ticketState) { if (ticketState == null) { return true; } final ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); final ZonedDateTime expirationTime = ticketState.getLastTimeUsed().plus(this.timeToKillInSeconds, ChronoUnit.SECONDS); return now.isAfter(expirationTime); }