class PurgeUnusedSnapshotsFacetImpl extends FacetSupport implements PurgeUnusedSnapshotsFacet {

  @VisibleForTesting
  String getUnusedWhere(final ORID bucketId) {
    return IntStream.range(0, findUnusedLimit)
        .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i))
        .collect(Collectors.joining(" OR "));
  }

  @Inject public  PurgeUnusedSnapshotsFacetImpl(
      final ComponentEntityAdapter componentEntityAdapter,
      @Named(GroupType.NAME) final Type groupType,
      @Named(HostedType.NAME) final Type hostedType,
      @Named("${nexus.tasks.purgeUnusedSnapshots.findUnusedLimit:-50}") int findUnusedLimit);

}