     
     func testData() {
         let key = "data"
-        let data = "foo".data(using: String.Encoding.utf8, allowLossyConversion: false)!
+        let data = "foo".data(using: .utf8, allowLossyConversion: false)!
         Defaults[key] = data
         XCTAssertEqual(Defaults[key].data!, data)
         XCTAssertNil(Defaults[key].string)

    func testStaticDate() {
        let key = DefaultsKey<Date?>("date")
        XCTAssert(Defaults[key] == nil)
        Defaults[key] = Date.distantPast
        XCTAssert(Defaults[key] == Date.distantPast)
        let now = Date()
        Defaults[key] = now
        XCTAssert(Defaults[key] == now)

        Defaults[key] = "foo"
        XCTAssert(Defaults[key] as? NSString == "foo")
        Defaults[key] = Date.distantPast
        XCTAssert(Defaults[key] as? Date == .distantPast)
    }
    
    func testStaticDataOptional() {
        let key = DefaultsKey<Data?>("data")
        XCTAssert(Defaults[key] == nil)
        let data = "foobar".data(using: .utf8)!
        Defaults[key] = data
        XCTAssert(Defaults[key] == data)
    }
