class BuildService extends AbstractService {

  public void save(final BuildDetails buildDetails) {
    buildDetails.setSequence(sequence.incrementAndGet());
    uuid2buildResult.put(buildDetails.getUuid(), buildDetails);
    logger.info("New build detected: {}", buildDetails);
    uuids.addFirst(buildDetails.getUuid());
    while (100 < uuids.size()) {
      final String uuid = uuids.removeLast();
      uuid2buildResult.remove(uuid);
    }
    for (final DangerousConsumer<BuildSummary> listener : listeners) {
      try {
        listener.accept(buildDetails.getSummary());
      } catch (final Throwable ex) {
        logger.trace("Ignore exception: {}", ex.getClass());
      }
    }
  }

}