code: public void onCompleteHandler(StreamElementQueueEntry<?> streamElementQueueEntry) throws InterruptedException {
  		lock.lockInterruptibly();
  
  		try {
  			if (firstSet.remove(streamElementQueueEntry)) {
  				completedQueue.offer(streamElementQueueEntry);
  
  				while (firstSet.isEmpty() && firstSet != lastSet) {
  					firstSet = uncompletedQueue.poll();
  
  					Iterator<StreamElementQueueEntry<?>> it = firstSet.iterator();
  
  					while (it.hasNext()) {
  						StreamElementQueueEntry<?> bufferEntry = it.next();
  
  						if (bufferEntry.isDone()) {
  							completedQueue.offer(bufferEntry);
  							it.remove();
  						}
  					}
  				}
  
  				LOG.debug("Signal unordered stream element queue has completed entries.");
  				hasCompletedEntries.signalAll();
  			}
  		} finally {
  			lock.unlock();
  		}
  	}
docs: Callback for onComplete events for the given stream element queue entry. Whenever a queue
  entry is completed, it is checked whether this entry belongs to the first set. If this is the
  case, then the element is added to the completed entries queue from where it can be consumed.
  If the first set becomes empty, then the next set is polled from the uncompleted entries
  queue. Completed entries from this new set are then added to the completed entries queue.
  
  @param streamElementQueueEntry which has been completed
  @throws InterruptedException if the current thread has been interrupted while performing the
  on complete callback.