 
     // MARK: [Int64: XXX]
 
-    func testToString_withArrayOfInt64ToBool() {
+    func testToBytes_withArrayOfInt64ToBool() {
         do {
             try subject.encode([[1: true], [3: true]] as [[Int64: Bool]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,33:m,11:z,1:1:b,1:t:m,11:z,1:3:b,1:t"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToInt() {
+            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,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,6,1,1,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,6,1,1]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_withArrayOfInt64ToInt() {
         do {
             try subject.encode([[1: 2], [3: 4]] as [[Int64: Int]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,33:m,11:z,1:1:i,1:2:m,11:z,1:3:i,1:4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToInt64() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,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_withArrayOfInt64ToInt64() {
         do {
             try subject.encode([[1: 2], [3: 4]] as [[Int64: Int64]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,33:m,11:z,1:1:z,1:2:m,11:z,1:3:z,1:4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToFloat() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfInt64ToFloat() {
         do {
             try subject.encode([[1: 0.2], [3: 0.4]] as [[Int64: Float]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:z,1:1:f,3:0.2:m,13:z,1:3:f,3:0.4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToDouble() {
+            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,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,5,4,0,0,0,0,0,0,0,205,204,76,62,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,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_withArrayOfInt64ToDouble() {
         do {
             try subject.encode([[1: 0.2], [3: 0.4]] as [[Int64: Double]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,37:m,13:z,1:1:d,3:0.2:m,13:z,1:3:d,3:0.4"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToString() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,201,63,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfInt64ToString() {
         do {
             try subject.encode([[1: "a"], [3: "b"]] as [[Int64: String]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,33:m,11:z,1:1:s,1:a:m,11:z,1:3:s,1:b"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,120,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,90,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,28,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,97,10,28,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfInt64ToCereal() {
         do {
             try subject.encode([[1: TestCerealType(foo: "bar")], [3: TestCerealType(foo: "baz")]] as [[Int64: TestCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,63:m,26:z,1:1:c,15:k,3:foo:s,3:bar:m,26:z,1:3:c,15:k,3:foo:s,3:baz"
-            XCTAssertEqual(result, expected)
-        } catch let error {
-            XCTFail("Encoding failed due to error: \(error)")
-        }
-    }
-
-    func testToString_withArrayOfInt64ToIdentifyingCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,184,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,154,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,60,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,60,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfInt64ToIdentifyingCereal() {
         do {
             try subject.encode([[1: TestIdentifyingCerealType(foo: "bar")], [3: TestIdentifyingCerealType(foo: "baz")]] as [[Int64: TestIdentifyingCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,77:m,33:z,1:1:p,22:4:tict:k,3:foo:s,3:bar:m,33:z,1: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_withArrayOfInt64ToProtocoledIdentifyingCereal() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,210,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,180,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfInt64ToProtocoledIdentifyingCereal() {
         do {
             let first: Fooable = TestIdentifyingCerealType(foo: "bar")
             let second: Fooable = TestIdentifyingCerealType(foo: "baz")
             try subject.encodeIdentifyingItems([[1: first], [3: second]] as [[Int64: IdentifyingCerealType]], forKey: "wat")
-            let result = subject.toString()
-            let expected = "k,3:wat:a,77:m,33:z,1:1:p,22:4:tict:k,3:foo:s,3:bar:m,33:z,1:3:p,22:4:tict:k,3:foo:s,3:baz"
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,210,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,180,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,3,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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)")


    // MARK: [Bool: XXX]

    func testToString_withArrayOfBoolToBool() {
        do {
            try subject.encode([[true: true], [false: false]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,33:m,11:b,1:t:b,1:t:m,11:b,1:f:b,1:f"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfBoolToInt() {
        do {
            try subject.encode([[true: 2], [true: 4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,33:m,11:b,1:t:i,1:2:m,11:b,1:t:i,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfBoolToInt64() {
        do {
            try subject.encode([[false: 2], [false: 4]] as [[Bool: Int64]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,33:m,11:b,1:f:z,1:2:m,11:b,1:f:z,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfBoolToFloat() {
        do {
            try subject.encode([[false: 0.2], [true: 0.4]] as [[Bool: Float]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,37:m,13:b,1:f:f,3:0.2:m,13:b,1:t:f,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfBoolToDouble() {
        do {
            try subject.encode([[true: 0.2], [false: 0.4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,37:m,13:b,1:t:d,3:0.2:m,13:b,1:f:d,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfBoolToString() {
        do {
            try subject.encode([[true: "a"], [false: "b"]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,33:m,11:b,1:t:s,1:a:m,11:b,1:f:s,1:b"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

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

    func testToString_withArrayOfBoolToIdentifyingCereal() {
        do {
            try subject.encode([[true: TestIdentifyingCerealType(foo: "bar")], [false: TestIdentifyingCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,77:m,33:b,1:t:p,22:4:tict:k,3:foo:s,3:bar:m,33:b,1:f: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_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.toString()
            let expected = "k,3:wat:a,77:m,33:b,1:t:p,22:4:tict:k,3:foo:s,3:bar:m,33:b,1:f:p,22:4:tict:k,3:foo:s,3:baz"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")


    // MARK: [Int: XXX]

    func testToBytes_withArrayOfIntToBool() {
        do {
            try subject.encode([[1: true], [3: false]], 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,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,6,1,1,10,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,6,1,0]
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToBytes_withArrayOfIntToInt() {
        do {
            try subject.encode([[1: 2], [3: 4]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,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_withArrayOfIntToInt64() {
        do {
            try subject.encode([[1: 2], [3: 4]] as [[Int: Int64]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,8,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfIntToFloat() {
        do {
            try subject.encode([[1: 0.2], [3: 0.4]] as [[Int: Float]], forKey: "wat")
            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,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,5,4,0,0,0,0,0,0,0,205,204,76,62,10,31,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,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_withArrayOfIntToDouble() {
        do {
            try subject.encode([[1: 0.2], [3: 0.4]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,134,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,104,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,201,63,10,35,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfIntToString() {
        do {
            try subject.encode([[1: "a"], [3: "b"]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,120,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,90,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,28,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,97,10,28,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfIntToCereal() {
        do {
            try subject.encode([[1: TestCerealType(foo: "bar")], [3: TestCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,184,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,154,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,60,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,60,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfIntToIdentifyingCereal() {
        do {
            try subject.encode([[1: TestIdentifyingCerealType(foo: "bar")], [3: TestIdentifyingCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,210,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,180,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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_withArrayOfIntToProtocoledIdentifyingCereal() {
        do {
            let first: Fooable = TestIdentifyingCerealType(foo: "bar")
            let second: Fooable = TestIdentifyingCerealType(foo: "baz")
            try subject.encodeIdentifyingItems([[1: first], [3: second]] as [[Int: IdentifyingCerealType]], forKey: "wat")
            let result = subject.toBytes()
            let expected: [UInt8] = [11,210,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,180,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,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,114,10,73,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,2,8,0,0,0,0,0,0,0,3,0,0,0,0,0,0,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)")
