         XCTAssertEqual(tinna.color, "lightgray", "Should be able to return the first record with given attributes.")
     }
     
-    // MARK: Finding All
+    func testFirstWithAttributesGeneric() {
+        let tinnaAttributes = ["name" : "Tinna", "color" : "lightgray"]
+        let tinna: Animal = Animal.firstWithAttributes(tinnaAttributes)!
+        XCTAssertEqual(tinna.color, "lightgray", "Should be able to return the first record with given attributes.")
+    }
+    
+    // MARK: Find All
     
     func testAll() {
         let animals = Animal.all()
         XCTAssertEqual(animals!.count, 7, "Should be able to return all records of entity.")
+    }
+    
+    func testAllGeneric() {
+        let animals: [Animal] = Animal.all()!
+        XCTAssertEqual(animals.count, 7, "Should be able to return all records of entity.")
     }
     
     func testAllWithPredicate() {

        XCTAssertEqual(tinna.color, "lightgray", "Should be able to create instance of entity with attributes.")
    }
    
    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.")
    }
    

        XCTAssertEqual(firstAnimal.name, "Betty", "Should be able to return the first record sorted by given sort descriptor.")
    }
    
    func testFirstGeneric() {
        let sortDescriptor = NSSortDescriptor(key: "name", ascending: true)
        let firstAnimal: Animal = Animal.first(sortDescriptors: [sortDescriptor])!
        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 testFirstWithPredicateGeneric() {
        let predicate = NSPredicate(format: "color == %@", "lightgray")
        let tinna: Animal = Animal.firstWithPredicate(predicate)!
        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 testFirstWithAttributeGeneric() {
        let kika: Animal = Animal.firstWithAttribute("color", value: "black")!
        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.")
    }
    
    func testFirstOrderedByAttributeGeneric() {
        let kika: Animal = Animal.firstOrderedByAttribute("color", ascending: true)!
        XCTAssertEqual(kika.name, "Kika", "Should be able to return the first record ordered by given attribute.")
    }
    
