// Reverse order of parts to ensure multipartCompleteUpload corrects the problem
Collections.reverse(listedParts);
// Complete multipart upload, despite badly ordered parts.
MultipartCompleted multipartCompleted = service.multipartCompleteUpload(
testMultipartUpload, listedParts);
assertEquals(multipartCompleted.getBucketName(), testMultipartUpload.getBucketName());
assertEquals(multipartCompleted.getObjectKey(), testMultipartUpload.getObjectKey());
// Confirm completed object exists and has expected size, metadata
S3Object completedObject = (S3Object) service.getObjectDetails(
bucketName, testMultipartUpload.getObjectKey());
assertEquals(completedObject.getContentLength(), fiveMBTestData.length * 2 + 1);