         }
     }
 
-    struct NestedContainersTestType: Encodable {
-        let testSuperEncoder: Bool
-
-        init(testSuperEncoder: Bool = false) {
-            self.testSuperEncoder = testSuperEncoder
+    struct NestedContainersTestType: Codable, Equatable {
+        let testSuperCoder: Bool
+
+        static func == (lhs: NestedContainersTestType, rhs: NestedContainersTestType) -> Bool {
+            return lhs.testSuperCoder == rhs.testSuperCoder
+        }
+
+        init(testSuperCoder: Bool = false) {
+            self.testSuperCoder = testSuperCoder
         }
 
         enum TopLevelCodingKeys: Int, CodingKey {
+            case testSuperCoder
             case a
             case b
             case c

                // Appending an unkeyed container should not change existing coding paths.
                let thirdLevelContainerUnkeyed = secondLevelContainer.nestedUnkeyedContainer()
                expectEqualPaths(encoder.codingPath, baseCodingPath, "Top-level Encoder's codingPath changed.")
                expectEqualPaths(firstLevelContainer.codingPath, baseCodingPath, "First-level keyed container's codingPath changed.")
                expectEqualPaths(secondLevelContainer.codingPath, baseCodingPath + [TopLevelCodingKeys.b], "Second-level unkeyed container's codingPath changed.")
                expectEqualPaths(thirdLevelContainerUnkeyed.codingPath, baseCodingPath + [TopLevelCodingKeys.b, _TestKey(index: 1)], "New third-level unkeyed container had unexpected codingPath.")

            case two
        }

        // swiftlint:disable line_length
        func encode(to encoder: Encoder) throws {
            var topLevelContainer = encoder.container(keyedBy: TopLevelCodingKeys.self)
            try topLevelContainer.encode(testSuperCoder, forKey: .testSuperCoder)

            if self.testSuperCoder {
                expectEqualPaths(encoder.codingPath, [], "Top-level Encoder's codingPath changed.")
                expectEqualPaths(topLevelContainer.codingPath, [], "New first-level keyed container has non-empty codingPath.")

