 
     // MARK: [Float: XXX]
 
-    func testToString_withArrayOfFloatToBool() {
+    func testToBytes_withArrayOfFloatToBool() {
         do {
             try subject.encode([[0.1: false], [0.3: false]] as [[Float: Bool]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:f,3:0.1:b,1:f:m,13:f,3:0.3:b,1:f"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToInt() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,68,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,6,1,0,10,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,6,1,0]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToInt() {
         do {
             try subject.encode([[0.1: 2], [0.3: 4]] as [[Float: Int]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:f,3:0.1:i,1:2:m,13:f,3:0.3:i,1:4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToInt64() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,126,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,96,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,2,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,2,8,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToInt64() {
         do {
             try subject.encode([[0.1: 2], [0.3: 4]] as [[Float: Int64]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:f,3:0.1:z,1:2:m,13:f,3:0.3:z,1:4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToFloat() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,126,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,96,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,3,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,3,8,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToFloat() {
         do {
             try subject.encode([[0.1: 0.2], [0.3: 0.4]] as [[Float: Float]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,41:m,15:f,3:0.1:f,3:0.2:m,15:f,3:0.3:f,3:0.4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToDouble() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,118,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,88,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,27,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,5,4,0,0,0,0,0,0,0,205,204,76,62,10,27,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,5,4,0,0,0,0,0,0,0,205,204,204,62]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToDouble() {
         do {
             try subject.encode([[0.1: 0.2], [0.3: 0.4]] as [[Float: Double]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,41:m,15:f,3:0.1:d,3:0.2:m,15:f,3:0.3:d,3:0.4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToString() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,126,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,96,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,201,63,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,217,63]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToString() {
         do {
             try subject.encode([[0.1: "a"], [0.3: "b"]] as [[Float: String]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:f,3:0.1:s,1:a:m,13:f,3:0.3:s,1:b"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,112,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,82,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,24,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,1,1,0,0,0,0,0,0,0,97,10,24,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,1,1,0,0,0,0,0,0,0,98]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToCereal() {
         do {
             try subject.encode([[0.1: TestCerealType(foo: "bar")], [0.3: TestCerealType(foo: "baz")]] as [[Float: TestCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,67:m,28:f,3:0.1:c,15:k,3:foo:s,3:bar:m,28:f,3:0.3:c,15:k,3:foo:s,3:baz"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToIdentifyingCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,176,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,146,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,56,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,11,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,56,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,11,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToIdentifyingCereal() {
         do {
             try subject.encode([[0.1: TestIdentifyingCerealType(foo: "bar")], [0.3: TestIdentifyingCerealType(foo: "baz")]] as [[Float: TestIdentifyingCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,81:m,35:f,3:0.1:p,22:4:tict:k,3:foo:s,3:bar:m,35:f,3:0.3:p,22:4:tict:k,3:foo:s,3:baz"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfFloatToProtocoledIdentifyingCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,202,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,172,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,69,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,69,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfFloatToProtocoledIdentifyingCereal() {
         do {
             let first: Fooable = TestIdentifyingCerealType(foo: "bar")
             let second: Fooable = TestIdentifyingCerealType(foo: "baz")
             try subject.encodeIdentifyingItems([[0.1: first], [0.3: second]] as [[Float: IdentifyingCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,81:m,35:f,3:0.1:p,22:4:tict:k,3:foo:s,3:bar:m,35:f,3:0.3:p,22:4:tict:k,3:foo:s,3:baz"
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,202,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,172,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,69,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,205,204,204,61,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,69,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,5,4,0,0,0,0,0,0,0,154,153,153,62,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
             XCTAssertEqual(result, expected)
         } catch let error {
             XCTFail("Encoding failed due to error: \(error)")


    // MARK: [CerealType: XXX]

    func testToString_withArrayOfCerealToBool() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): true], [TestCerealType(foo: "oof"): false]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,63:m,26:c,15:k,3:foo:s,3:foo:b,1:t:m,26:c,15:k,3:foo:s,3:oof:b,1:f"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToInt() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): 2], [TestCerealType(foo: "oof"): 4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,63:m,26:c,15:k,3:foo:s,3:foo:i,1:2:m,26:c,15:k,3:foo:s,3:oof:i,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToInt64() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): 2], [TestCerealType(foo: "oof"): 4]] as [[TestCerealType: Int64]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,63:m,26:c,15:k,3:foo:s,3:foo:z,1:2:m,26:c,15:k,3:foo:s,3:oof:z,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToFloat() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): 0.2], [TestCerealType(foo: "oof"): 0.4]] as [[TestCerealType: Float]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,67:m,28:c,15:k,3:foo:s,3:foo:f,3:0.2:m,28:c,15:k,3:foo:s,3:oof:f,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToDouble() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): 0.2], [TestCerealType(foo: "oof"): 0.4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,67:m,28:c,15:k,3:foo:s,3:foo:d,3:0.2:m,28:c,15:k,3:foo:s,3:oof:d,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToString() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): "a"], [TestCerealType(foo: "oof"): "b"]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,63:m,26:c,15:k,3:foo:s,3:foo:s,1:a:m,26:c,15:k,3:foo:s,3:oof:s,1:b"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToCereal() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): TestCerealType(foo: "bar")], [TestCerealType(foo: "oof"): TestCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,93:m,41:c,15:k,3:foo:s,3:foo:c,15:k,3:foo:s,3:bar:m,41:c,15:k,3:foo:s,3:oof:c,15:k,3:foo:s,3:baz"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToIdentifyingCereal() {
        do {
            try subject.encode([[TestCerealType(foo: "foo"): TestIdentifyingCerealType(foo: "bar")], [TestCerealType(foo: "oof"): TestIdentifyingCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,107:m,48:c,15:k,3:foo:s,3:foo:p,22:4:tict:k,3:foo:s,3:bar:m,48:c,15:k,3:foo:s,3:oof:p,22:4:tict:k,3:foo:s,3:baz"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfCerealToProtocoledIdentifyingCereal() {
        do {
            let first: Fooable = TestIdentifyingCerealType(foo: "bar")
            let second: Fooable = TestIdentifyingCerealType(foo: "baz")
            try subject.encodeIdentifyingItems([[TestCerealType(foo: "foo"): first], [TestCerealType(foo: "oof"): second]] as [[TestCerealType: IdentifyingCerealType]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,107:m,48:c,15:k,3:foo:s,3:foo:p,22:4:tict:k,3:foo:s,3:bar:m,48:c,15:k,3:foo:s,3:oof:p,22:4:tict:k,3:foo:s,3:baz"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")


    // MARK: [Bool: XXX]

    func testToBytes_withArrayOfBoolToBool() {
        do {
            try subject.encode([[true: true], [false: false]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,78,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,48,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,7,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,6,1,1,10,7,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,6,1,0]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToInt() {
        do {
            try subject.encode([[true: 2], [true: 4]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,106,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,76,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,2,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,2,8,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToInt64() {
        do {
            try subject.encode([[false: 2], [false: 4]] as [[Bool: Int64]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,106,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,76,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,3,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,3,8,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToFloat() {
        do {
            try subject.encode([[false: 0.2], [true: 0.4]] as [[Bool: Float]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,68,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,5,4,0,0,0,0,0,0,0,205,204,76,62,10,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,5,4,0,0,0,0,0,0,0,205,204,204,62]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToDouble() {
        do {
            try subject.encode([[true: 0.2], [false: 0.4]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,106,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,76,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,201,63,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,217,63]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToString() {
        do {
            try subject.encode([[true: "a"], [false: "b"]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,92,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,62,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,14,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,1,1,0,0,0,0,0,0,0,97,10,14,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,1,1,0,0,0,0,0,0,0,98]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToCereal() {
        do {
            try subject.encode([[true: TestCerealType(foo: "bar")], [false: TestCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,156,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,126,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,46,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,11,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,46,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,11,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToIdentifyingCereal() {
        do {
            try subject.encode([[true: TestIdentifyingCerealType(foo: "bar")], [false: TestIdentifyingCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,182,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,152,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,59,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,59,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfBoolToProtocoledIdentifyingCereal() {
        do {
            let first: Fooable = TestIdentifyingCerealType(foo: "bar")
            let second: Fooable = TestIdentifyingCerealType(foo: "baz")
            try subject.encodeIdentifyingItems([[true: first], [false: second]] as [[Bool: IdentifyingCerealType]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,182,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,119,97,116,10,152,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,59,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,1,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,114,10,59,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,6,1,0,12,1,4,0,0,0,0,0,0,0,116,105,99,116,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,1,3,0,0,0,0,0,0,0,102,111,111,1,3,0,0,0,0,0,0,0,98,97,122]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
