anchor.diff:  }
   
   class MockCounter implements PersistentCounter {
  +  Map<String, int> counter = {};
   
     @override
     Future<int> getTotal(String name) {
  -    return new Future.value(42);
  +    counter.putIfAbsent(name, () => 0);
  +    return new Future.value(counter[name]);
     }
   
     @override
     Future increment(String name, {int increment : 1}) {
  -    return new Future.value();
  -  }
  -}
  +    counter.putIfAbsent(name, () => 0);
  +    return new Future.value(counter[name]++);
  +  }
  +}
  
positive.code:     assert(apiServer != null);
      var body = new Stream.fromIterable([UTF8.encode(JSON.encode(json))]);
      var request = new HttpApiRequest('POST', path, {}, {}, body);
      return apiServer.handleHttpApiRequest(request);
    }
  
  
negative.code:       var response = await _sendPostRequest('dartservices/v1/document', json);
        expect(response.status, 400);
      });
  
      test('counter test', () async {
        var response =
          await _sendGetRequest('dartservices/v1/counter', {"name" : "Analyses"});
        var data = JSON.decode(UTF8.decode(await response.body.first));
        expect(response.status, 200);
        expect(data['count'], 0);
  
        // Do an Analysis.
        var json = {'source': sampleCode};
        response = await _sendPostRequest('dartservices/v1/analyze', json);
  
        response =
          await _sendGetRequest('dartservices/v1/counter', {"name" : "Analyses"});
        data = JSON.decode(UTF8.decode(await response.body.first));
        expect(response.status, 200);
        expect(data['count'], 1);
      });
    });
  }
  
  