// Re-retrieve object to ensure it was correctly created.
basicObject = service.getObject(bucketName, object.getKey());
assertEquals("Unexpected content type",
Mimetypes.MIMETYPE_OCTET_STREAM, basicObject.getContentType());
assertEquals("Unexpected size for 'empty' object", 0, basicObject.getContentLength());
basicObject.closeDataInputStream();
// Make sure bucket cannot be removed while it has contents.
try {
service.deleteBucket(bucketName);
fail("Should not be able to delete a bucket containing objects");