code: private void lockToPartitionKey(final String partitionKey) {
          if (this.partitionKey == null) {
              this.partitionKey = partitionKey;
          }
          else {
              if (partitionKey.length() != partitionKey.length() || !this.partitionKey.equals(partitionKey)) {
                  throw new IllegalArgumentException(SR.OPS_IN_BATCH_MUST_HAVE_SAME_PARTITION_KEY);
              }
          }
      }
docs: Reserved for internal use. Verifies that the specified PartitionKey value matches the value in the batch
  operation.
  
  @param partitionKey
  The <code>String</code> containing the PartitionKey value to check.