code: public static long getLastByteInPart(AmazonS3 s3, GetObjectRequest getObjectRequest, Integer partNumber) {
          ValidationUtils.assertNotNull(s3, "S3 client");
          ValidationUtils.assertNotNull(getObjectRequest, "GetObjectRequest");
          ValidationUtils.assertNotNull(partNumber, "partNumber");
  
          GetObjectMetadataRequest getObjectMetadataRequest = RequestCopyUtils.createGetObjectMetadataRequestFrom(getObjectRequest)
                  .withPartNumber(partNumber);
          ObjectMetadata metadata = s3.getObjectMetadata(getObjectMetadataRequest);
          return metadata.getContentRange()[1];
      }
docs: Returns the last byte number in a part of an object.
  
  @param s3
  The Amazon s3 client.
  @param getObjectRequest
  The request to check.
  @param partNumber
  The part in which we need the last byte number.
  @return
  The last byte number in the part.