code: <T> CompletableFuture<T> executeIfEmpty(DirectSegmentAccess segment, Supplier<CompletableFuture<T>> action, TimeoutTimer timer) {
          return this.recoveryTracker.waitIfNeeded(segment, () -> this.conditionalUpdateProcessor.addWithFilter(
                  conditionKey -> conditionKey.getKey() == segment.getSegmentId(),
                  () -> isTableSegmentEmpty(segment, timer)
                          .thenCompose(isEmpty -> {
                              if (isEmpty) {
                                  // Segment is empty.
                                  return action.get();
                              } else {
                                  // Segment is not empty.
                                  return Futures.failedFuture(new TableSegmentNotEmptyException(segment.getInfo().getName()));
                              }
                          })));
      }
docs: Executes the given action only if the Segment is empty.
  
  This is a conditional operation that will execute serially after all currently executing conditional updates on
  the given Segment have completed. Any subsequent conditional updates on the given Segment will be blocked until
  this action completes executing. Unconditional updates will not block the execution of this action, nor will they
  be blocked by its execution.
  
  Similarly to conditional updates, this can be used to ensure consistency across the TableSegment, making sure that
  the action only executes if a specific condition is met, while making sure no other consistency-related operations
  may begin while it is running.
  
  A deadlock will occur if action is used to perform a conditional update on the same segment. If an update is
  required, then an unconditional update should be executed via action.
  
  @param segment The Segment to perform the action on.
  @param action  A Supplier that, when invoked, will begin executing the action. This returns a CompletableFuture
  that will indicate when the action completed.
  @param timer   Timer for the operation.
  @param <T>     Return type.
  @return A CompletableFuture that, when completed normally, will indicate that the action was executed. If it failed,
  or if the segment is not empty, it will be failed with the appropriate exception. Notable exceptions:
  <ul>
  <li>{@link TableSegmentNotEmptyException} If the Segment is not empty.
  </ul>