anchor.diff:  
             var bucket = api.bucket(bucketName);
             var sink = bucket.write(bucketName, length: length);
  -          sink.done.then<Null>((_) => throw 'Unexpected').catchError(
  -              expectAsync1(expectNotNull),
  -              test: testDetailedApiError);
  -          sink.done.catchError(expectAsync1(expectNotNull),
  -              test: testDetailedApiError);
  -          return Stream.fromIterable([bytesNormalUpload])
  -              .pipe(sink)
  -              .then<Null>((_) => throw 'Unexpected')
  -              .catchError(expectAsync1(expectNotNull),
  -                  test: testDetailedApiError);
  +          expect(sink.done, throwsA(isDetailedApiError));
  +          return expectLater(
  +              Stream.fromIterable([bytesNormalUpload]).pipe(sink),
  +              throwsA(isDetailedApiError));
           }
   
           test(null) // Unknown length.
  
positive.code: 
          var bucket = api.bucket(bucketName);
          var sink = bucket.write(bucketName);
          sink.done
              .then<Null>((_) => throw 'Unexpected')
              .catchError(expectAsync1(expectNotNull), test: testArgumentError);
          var stream = Stream.fromIterable([bytesResumableUpload]);
          sink.addStream(stream).then((_) {
            sink.addError(ArgumentError());
            sink
                .close()
                .catchError(expectAsync1(expectNotNull), test: testArgumentError);
          });
        });
      });
  
negative.code: 
            var bucket = api.bucket(bucketName);
            var sink = bucket.write(bucketName);
            expect(sink.done, throwsA(isDetailedApiError));
            return expectLater(
                Stream.fromIterable([bytesResumableUpload]).pipe(sink),
                throwsA(isDetailedApiError));
          }
  
          test(null) // Unknown length.
  