anchor.diff:  
       group('with class annotations', () {
         test('annotated with class', () {
  -        var annotatedClass = _getAnnotationForClass(libElement, 'CtorNoParams');
  -        var annotation = annotatedClass.metadata.single;
  +        var annotation = _getClassAnnotation(libElement, 'CtorNoParams');
           var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
           expect(matched, isTrue);
         });
   
         test('not annotated with specified class', () {
  -        var annotatedClass =
  -            _getAnnotationForClass(libElement, 'OtherClassCtorNoParams');
  -        var annotation = annotatedClass.metadata.single;
  +        var annotation =
  +            _getClassAnnotation(libElement, 'OtherClassCtorNoParams');
           var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
           expect(matched, isFalse, reason: 'not annotated with that type');
         });
   
         test('annotated with class in a part', () {
  -        ClassElement annotatedClass =
  -            _getAnnotationForClass(libElement, 'CtorNoParamsFromPartInPart');
  -        var annotation = annotatedClass.metadata.single;
  +        var annotation =
  +            _getClassAnnotation(libElement, 'CtorNoParamsFromPartInPart');
           var matched =
               matchAnnotation(defs.PublicAnnotationClassInPart, annotation);
           expect(matched, isTrue);
         });
   
         test('class in a part annotated with class', () {
  -        var annotatedClass =
  -            _getAnnotationForClass(libElement, 'CtorNoParamsInPart');
  -        var annotation = annotatedClass.metadata.single;
  +        var annotation = _getClassAnnotation(libElement, 'CtorNoParamsInPart');
           var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
           expect(matched, isTrue);
         });
   
         test('class in a part annotated with class in a part', () {
  -        ClassElement annotatedClass =
  -            _getAnnotationForClass(libElement, 'CtorNoParamsFromPartInPart');
  -        var annotation = annotatedClass.metadata.single;
  +        var annotation =
  +            _getClassAnnotation(libElement, 'CtorNoParamsFromPartInPart');
           var matched =
               matchAnnotation(defs.PublicAnnotationClassInPart, annotation);
           expect(matched, isTrue);
  
positive.code:     });
  
      test('with nested objects', () {
        var annotatedClass =
            _getAnnotationForClass(libElement, 'WithNestedObjects');
        var annotation = annotatedClass.metadata.single;
        var instance =
            instantiateAnnotation(annotation) as defs.PublicAnnotationClass;
        expect(instance.child1, const defs.PublicAnnotationClass());
        expect(
            instance.child2, const defs.PublicAnnotationClass.withAnIntAsOne());
      });
  
      test('with built-in Symbol', () {
        var annotatedClass = _getAnnotationForClass(libElement, 'WithSymbol');
        var annotation = annotatedClass.metadata.single;
        var instance = instantiateAnnotation(annotation);
        expect(instance, defs.objectAnnotation);
      });
  
      test('with a field using non-default ctor', () {
        var annotatedClass =
            _getAnnotationForClass(libElement, 'WithAFieldFromNonDefaultCtor');
        var annotation = annotatedClass.metadata.single;
        var instance =
            instantiateAnnotation(annotation) as defs.PublicAnnotationClass;
        expect(instance.anInt, defs.untypedAnnotationWithNonDefaultCtor.anInt);
        expect(
            instance.aString, defs.untypedAnnotationWithNonDefaultCtor.aString);
  
negative.code:   group('matchAnnotation', () {
      group('with field annotations', () {
        test('annotated with typed field', () {
          var annotation = _getClassAnnotation(libElement, 'WithTypedField');
          var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
          expect(matched, isTrue);
        });
  
        test('annotated with untyped field', () {
          var annotation = _getClassAnnotation(libElement, 'WithUntypedField');
          var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
          expect(matched, isTrue);
        });
  
        test('annotated with local typed field', () {
          var annotation = _getClassAnnotation(libElement, 'WithLocalTypedField');
          var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
          expect(matched, isTrue);
        });
  
        test('annotated with local untyped field', () {
          var annotation =
              _getClassAnnotation(libElement, 'WithLocalUntypedField');
          var matched = matchAnnotation(defs.PublicAnnotationClass, annotation);
          expect(matched, isTrue);
        });
  