         XCTAssertEqual(tinna.color, "lightgray", "Should be able to create instance of entity with attributes.")
     }
     
+    // MARK: Find First or Create
+    
     func testFirstOrCreateWithAttribute() {
         let snoopy = Animal.firstOrCreateWithAttribute("name", value: "Snoopy") as! Animal
         XCTAssertEqual(snoopy.name, "Snoopy", "Should be able to create record if it doesn't already exist.")
         
         let tinna = Animal.firstOrCreateWithAttribute("name", value: "Tinna") as! Animal
+        XCTAssertEqual(tinna.color, "lightgray", "Should be able to return the first record with given attribute.")
+    }
+    
+    func testFirstOrCreateWithAttributeGeneric() {
+        let snoopy: Animal = Animal.firstOrCreateWithAttribute("name", value: "Snoopy")
+        XCTAssertEqual(snoopy.name, "Snoopy", "Should be able to create record if it doesn't already exist.")
+        
+        let tinna: Animal = Animal.firstOrCreateWithAttribute("name", value: "Tinna")
         XCTAssertEqual(tinna.color, "lightgray", "Should be able to return the first record with given attribute.")
     }
     

        XCTAssertEqual(firstAnimal.name, "Betty", "Should be able to return the first record sorted by given sort descriptor.")
    }
    
    func testFirstWithPredicate() {
        let predicate = NSPredicate(format: "color == %@", "lightgray")
        let tinna = Animal.firstWithPredicate(predicate) as! Animal
        XCTAssertEqual(tinna.name, "Tinna", "Should be able to return the first record for given predicate.")
    }
    
    func testFirstWithAttribute() {
        let kika = Animal.firstWithAttribute("color", value: "black") as! Animal
        XCTAssertEqual(kika.name, "Kika", "Should be able to return the first record for given attribute.")
    }
    
    func testFirstOrderedByAttribute() {
        let kika = Animal.firstOrderedByAttribute("color", ascending: true) as! Animal
        XCTAssertEqual(kika.name, "Kika", "Should be able to return the first record ordered by given attribute.")
    }
    

        XCTAssertEqual(whiteAnimals!.count, 2, "Should be able to return all records for given attributes and OR predicate type.")
    }
    
    func testAllWithAttributesGeneric() {
        let whiteAttributes = ["name" : "Villy", "color" : "white"]
        
        let villy: [Animal] = Animal.allWithAttributes(whiteAttributes)!
        XCTAssertEqual(villy.count, 1, "Should be able to return all records for given attributes.")
        XCTAssertEqual(villy.first!.name, "Villy", "Should be able to return all records for given attributes.")
        
        let whiteAnimals: [Animal] = Animal.allWithAttributes(whiteAttributes, predicateType: .OrPredicateType)!
        XCTAssertEqual(whiteAnimals.count, 2, "Should be able to return all records for given attributes and OR predicate type.")
    }
    
    // MARK: Delete
    
    func testDelete() {
        let sortDescriptor = NSSortDescriptor(key: "name", ascending: true)
