anchor.diff:            .removeWhere((name, fe) => !fieldsSetByFactory.contains(name));
       }
       return accessibleFields.values.toSet();
  +  }
  +
  +  void _writeChecks(int indent, JsonSerializable classAnnotation,
  +      Map<String, FieldElement> accessibleFields) {
  +    if (classAnnotation.disallowUnrecognizedKeys) {
  +      var listLiteral = jsonLiteralAsDart(
  +          accessibleFields.values.map(_nameAccess).toList(), true);
  +
  +      _buffer.writeln('${' ' * indent}\$checkAllowedKeys(json, $listLiteral);');
  +    }
     }
   
     void _writeWrapper(Iterable<FieldElement> fields) {
  
positive.code: 
          fieldsSetByFactory = data.usedCtorParamsAndFields;
  
          if (_annotation.disallowUnrecognizedKeys) {
            var listLiteral = jsonLiteralAsDart(
                accessibleFields.values.map(_nameAccess).toList(), true);
            _buffer.write('''
        \$checkAllowedKeys(json, $listLiteral);''');
          }
          _buffer.write('''
      var val = ${data.content};''');
  
  
negative.code: 
          fieldsSetByFactory = data.usedCtorParamsAndFields;
  
          _writeChecks(2, _annotation, accessibleFields);
  
          _buffer.write('''
    return ${data.content}''');
  