 
     // MARK: [CerealType: XXX]
 
-    func testToString_withArrayOfCerealToBool() {
+    func testToBytes_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() {
+            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,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,102,111,111,6,1,1,10,46,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,6,1,0]
+            XCTAssertEqual(result, expected)
+        } catch let error {
+            XCTFail("Encoding failed due to error: \(error)")
+        }
+    }
+
+    func testToBytes_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() {
+            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,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,102,111,111,2,8,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,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,111,111,102,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_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() {
+            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,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,102,111,111,3,8,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,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,111,111,102,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_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() {
+            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,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,102,111,111,5,4,0,0,0,0,0,0,0,205,204,76,62,10,56,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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_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() {
+            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,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,102,111,111,4,8,0,0,0,0,0,0,0,154,153,153,153,153,153,201,63,10,60,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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_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() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,170,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,140,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,53,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,102,111,111,1,1,0,0,0,0,0,0,0,97,10,53,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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_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() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,234,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,204,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,85,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,102,111,111,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,85,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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_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() {
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,4,1,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,230,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,102,111,111,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,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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_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"
+            let result = subject.toBytes()
+            let expected: [UInt8] = [11,4,1,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,230,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,10,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,102,111,111,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,98,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,9,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,111,111,102,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: [Double: XXX]

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

    func testToString_withArrayOfDoubleToInt() {
        do {
            try subject.encode([[0.1: 2], [0.3: 4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,37:m,13:d,3:0.1:i,1:2:m,13:d,3:0.3:i,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfDoubleToInt64() {
        do {
            try subject.encode([[0.1: 2], [0.3: 4]] as [[Double: Int64]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,37:m,13:d,3:0.1:z,1:2:m,13:d,3:0.3:z,1:4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfDoubleToFloat() {
        do {
            try subject.encode([[0.1: 0.2], [0.3: 0.4]] as [[Double: Float]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,41:m,15:d,3:0.1:f,3:0.2:m,15:d,3:0.3:f,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfDoubleToDouble() {
        do {
            try subject.encode([[0.1: 0.2], [0.3: 0.4]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,41:m,15:d,3:0.1:d,3:0.2:m,15:d,3:0.3:d,3:0.4"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfDoubleToString() {
        do {
            try subject.encode([[0.1: "a"], [0.3: "b"]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,37:m,13:d,3:0.1:s,1:a:m,13:d,3:0.3:s,1:b"
            XCTAssertEqual(result, expected)
        } catch let error {
            XCTFail("Encoding failed due to error: \(error)")
        }
    }

    func testToString_withArrayOfDoubleToCereal() {
        do {
            try subject.encode([[0.1: TestCerealType(foo: "bar")], [0.3: TestCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,67:m,28:d,3:0.1:c,15:k,3:foo:s,3:bar:m,28:d,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_withArrayOfDoubleToIdentifyingCereal() {
        do {
            try subject.encode([[0.1: TestIdentifyingCerealType(foo: "bar")], [0.3: TestIdentifyingCerealType(foo: "baz")]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,81:m,35:d,3:0.1:p,22:4:tict:k,3:foo:s,3:bar:m,35:d,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_withArrayOfDoubleToProtocoledIdentifyingCereal() {
        do {
            let first: Fooable = TestIdentifyingCerealType(foo: "bar")
            let second: Fooable = TestIdentifyingCerealType(foo: "baz")
            try subject.encodeIdentifyingItems([[0.1: first], [0.3: second]] as [[Double: IdentifyingCerealType]], forKey: "wat")
            let result = subject.toString()
            let expected = "k,3:wat:a,81:m,35:d,3:0.1:p,22:4:tict:k,3:foo:s,3:bar:m,35:d,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)")


    // 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)")
