code: public boolean allAreFinished(final Set<ProcessorGraphNode<?, ?>> processorNodes) {
          this.processorLock.lock();
          try {
              for (ProcessorGraphNode<?, ?> node: processorNodes) {
                  if (!isFinished(node)) {
                      return false;
                  }
              }
              return true;
          } finally {
              this.processorLock.unlock();
          }
  
      }
docs: Verify that all processors have finished executing atomically (within the same lock as {@link
  #finished(ProcessorGraphNode)} and {@link #isFinished(ProcessorGraphNode)} is within.
  
  @param processorNodes the node to check for completion.