code: public void patchPool(String poolId, StartTask startTask, Collection<CertificateReference> certificateReferences,
              Collection<ApplicationPackageReference> applicationPackageReferences, Collection<MetadataItem> metadata,
              Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
          PoolPatchOptions options = new PoolPatchOptions();
          BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
          bhMgr.applyRequestBehaviors(options);
  
          PoolPatchParameter param = new PoolPatchParameter().withStartTask(startTask);
          if (metadata != null) {
              param.withMetadata(new LinkedList<>(metadata));
          }
          if (applicationPackageReferences != null) {
              param.withApplicationPackageReferences(new LinkedList<>(applicationPackageReferences));
          }
          if (certificateReferences != null) {
              param.withCertificateReferences(new LinkedList<>(certificateReferences));
          }
  
          this.parentBatchClient.protocolLayer().pools().patch(poolId, param, options);
      }
docs: Updates the specified pool. This method only replaces the properties
  specified with non-null values.
  
  @param poolId
  The ID of the pool.
  @param startTask
  A task to run on each compute node as it joins the pool. If null,
  any existing start task is left unchanged.
  @param certificateReferences
  A collection of certificates to be installed on each compute node
  in the pool. If null, any existing certificate references are left
  unchanged.
  @param applicationPackageReferences
  A collection of application packages to be installed on each
  compute node in the pool. If null, any existing application
  packages references are left unchanged.
  @param metadata
  A collection of name-value pairs associated with the pool as
  metadata. If null, any existing metadata is left unchanged.
  @param additionalBehaviors
  A collection of {@link BatchClientBehavior} instances that are
  applied to the Batch service request.
  @throws BatchErrorException
  Exception thrown when an error response is received from the
  Batch service.
  @throws IOException
  Exception thrown when there is an error in
  serialization/deserialization of data sent to/received from the
  Batch service.