code: private <T> QueuedCallback<T> checkConcurrentAssignment(String segmentName, Function<Long, CompletableFuture<T>> thenCompose) {
          QueuedCallback<T> queuedCallback = null;
          synchronized (this.pendingRequests) {
              PendingRequest pendingRequest = this.pendingRequests.getOrDefault(segmentName, null);
              if (pendingRequest != null) {
                  queuedCallback = new QueuedCallback<>(thenCompose);
                  pendingRequest.callbacks.add(queuedCallback);
              }
          }
          return queuedCallback;
      }
docs: Attempts to piggyback a task on any existing concurrent assignment, if any such assignment exists.
  
  @param segmentName The Name of the StreamSegment to attempt to piggyback on.
  @param thenCompose A Function that consumes a StreamSegmentId and returns a CompletableFuture that will indicate
  when the consumption of that StreamSegmentId is complete. This Function will be invoked
  synchronously if the StreamSegmentId is already mapped, or async, otherwise, after assignment.
  @param <T>         Type of the return value.
  @return A QueuedCallback representing the callback object for this task, if it was piggybacked on any existing
  assignment. If no assignment was found, returns null.