anchor.diff:  
   let shouldEqual (x:'a) (y:'a) = Assert.AreEqual(x, y)
   
  +let toRecord fields = InferedType.Record (None, fields, false)
  +
  +let toCollection typ mult =
  +    let tag = typeTag typ
  +    InferedType.Collection([ tag ], Map.ofList [ tag, (mult, typ) ])
  +
   /// A collection containing just one type
  -let SimpleCollection typ =
  -    InferedType.Collection([typeTag typ], Map.ofSeq [typeTag typ, (InferedMultiplicity.Multiple, typ)])
  -
  -let toRecord fields = InferedType.Record(None, fields, false)
  +let SimpleCollection typ = toCollection typ InferedMultiplicity.Multiple
   
   let primitiveProperty<'T> name optional =
       { Name = name
  -      Type = InferedType.Primitive(typeof<'T>, None, optional) }
  +      Type = InferedType.Primitive (typeof<'T>, None, optional) }
  +
  +let collectionProperty<'T> name mult =
  +    let prop = primitiveProperty<'T> name false
  +    { prop with Type = toCollection prop.Type mult }
  +
  +let bsonValue<'T> =
  +    let typ = typeof<'T>
  +    if typ = typeof<bool> then
  +        BsonBoolean false :> BsonValue
  +    elif typ = typeof<int> then
  +        BsonInt32 0 :> BsonValue
  +    elif typ = typeof<int64> then
  +        BsonInt64 0L :> BsonValue
  +    elif typ = typeof<float> then
  +        BsonDouble 0.0 :> BsonValue
  +    elif typ = typeof<string> then
  +        BsonString "0" :> BsonValue
  +    else
  +        failwithf "unsupported type %A" typ
  +
  +let bsonArray<'T> mult =
  +    let values =
  +        match mult with
  +        | InferedMultiplicity.Single -> [ bsonValue<'T> ]
  +        | InferedMultiplicity.Multiple -> [ bsonValue<'T>; bsonValue<'T> ]
  +        | InferedMultiplicity.OptionalSingle -> []
  +    BsonArray values
   
   [<Test>]
   let ``Infer type of empty document``() =
       let source = BsonDocument()
  -    let expected = InferedType.Record(None, [], false)
  +    let expected = InferedType.Record (None, [], false)
       let actual = BsonInference.inferType "" source
       actual |> shouldEqual expected
   
   [<Test>]
   let ``Infer type of empty array``() =
       let source = BsonArray()
  -    let expected = InferedType.Collection([], Map.empty)
  +    let expected = InferedType.Collection ([], Map.empty)
       let actual = BsonInference.inferType "" source
       actual |> shouldEqual expected
   
  
positive.code: 
  [<Test>]
  let ``Infer type of int array fields``() =
      let x : BsonValue list = [] // avoid ambiguous constructor
      let empty = BsonArray x
      let single = BsonArray [ BsonInt32 0 ]
      let multiple = BsonArray [ BsonInt32 0; BsonInt32 0 ]
      let source =
          BsonArray [ BsonDocument([ BsonElement("field_single", single)
                                     BsonElement("field_multiple", multiple)
  
negative.code:                     BsonDocument("field", BsonString "0") ]
  
      let cases =
          [ InferedTypeTag.Number, InferedType.Primitive (typeof<int>, None, false)
            InferedTypeTag.String, InferedType.Primitive (typeof<string>, None, false) ]
          |> Map.ofList
  
      let expected =
  