code: @Override
      @Scheduled(fixedRate = REAP_INTERVAL)
      public void removeExpired() {
          final Set<String> reapable = sessions.entrySet().stream()
                  .filter(e -> e.getValue().getExpires().isPresent())
                  .filter(e -> e.getValue().getExpires().get().isBefore(now()))
                  .map(Map.Entry::getKey).collect(toSet());
          reapable.forEach(key -> {
              final FedoraSession s = sessions.get(key);
              if (s != null) {
                  try {
                      s.expire();
                  } catch (final RepositoryRuntimeException e) {
                      LOGGER.error("Got exception rolling back expired session {}: {}", s, e.getMessage());
                  }
              }
              sessions.remove(key);
          });
      }
docs: Every REAP_INTERVAL milliseconds, check for expired sessions. If the
  tx is expired, roll it back and remove it from the registry.