code: public static long calculateOptimalPartSize(PutObjectRequest putObjectRequest, TransferManagerConfiguration configuration) {
          double contentLength = TransferManagerUtils.getContentLength(putObjectRequest);
          double optimalPartSize = (double)contentLength / (double)MAXIMUM_UPLOAD_PARTS;
          // round up so we don't push the upload over the maximum number of parts
          optimalPartSize = Math.ceil(optimalPartSize);
          return (long)Math.max(optimalPartSize, configuration.getMinimumUploadPartSize());
      }
docs: Returns the optimal part size, in bytes, for each individual part upload
  in a multipart upload.
  
  @param putObjectRequest
  The request containing all the details of the upload.
  @param configuration
  Configuration values to use when calculating size.
  
  @return The optimal part size, in bytes, for each individual part upload
  in a multipart upload.