code: public void resizePool(String poolId, Integer targetDedicatedNodes, Integer targetLowPriorityNodes,
              Period resizeTimeout, ComputeNodeDeallocationOption deallocationOption,
              Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
          PoolResizeOptions options = new PoolResizeOptions();
          BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
          bhMgr.applyRequestBehaviors(options);
  
          PoolResizeParameter param = new PoolResizeParameter().withResizeTimeout(resizeTimeout)
                  .withNodeDeallocationOption(deallocationOption).withTargetDedicatedNodes(targetDedicatedNodes)
                  .withTargetLowPriorityNodes(targetLowPriorityNodes);
  
          this.parentBatchClient.protocolLayer().pools().resize(poolId, param, options);
      }
docs: Resizes the specified pool.
  
  @param poolId
  The ID of the pool.
  @param targetDedicatedNodes
  The desired number of dedicated compute nodes in the pool.
  @param targetLowPriorityNodes
  The desired number of low-priority compute nodes in the pool.
  @param resizeTimeout
  The timeout for allocation of compute nodes to the pool or removal
  of compute nodes from the pool. If the pool has not reached the
  target size after this time, the resize is stopped.
  @param deallocationOption
  Specifies when nodes may be removed from the pool, if the pool
  size is decreasing.
  @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.