anchor.diff:  
             var bucket = api.bucket(bucketName);
             var sink = bucket.write(bucketName, length: length);
  -          sink.done.then<Null>((_) => throw 'Unexpected').catchError(
  -              expectAsync1(expectNotNull),
  -              test: (e) => e is String || e is storage.ApiRequestError);
  -          return Stream<List<int>>.fromIterable(data)
  -              .pipe(sink)
  -              .then<Null>((_) => throw 'Unexpected')
  -              .catchError(expectAsync1(expectNotNull),
  -                  test: (e) => e is String || e is storage.ApiRequestError);
  +          expect(sink.done,
  +              throwsA(anyOf(isA<String>(), isA<storage.ApiRequestError>())));
  +          return expectLater(Stream<List<int>>.fromIterable(data).pipe(sink),
  +              throwsA(anyOf(isA<String>(), isA<storage.ApiRequestError>())));
           }
   
           test([bytesResumableUpload], bytesResumableUpload.length + 1)
  
positive.code: 
            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);
          }
  
          test(null) // Unknown length.
  
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.
  