         var count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
         XCTAssertEqual(1, count, "Count mismatch")
         
-        checkPreficate(expectedPredicate, resultPredicate: predicate)
+        checkPredicate(expectedPredicate, resultPredicate: predicate)
         
         predicate = NSPredicate.predicateBuilder("level", value: 1, predicateOperator: .Equal)
         expectedPredicate = NSPredicate(format: "level == 1")
-        checkPreficate(expectedPredicate, resultPredicate: predicate)
+        checkPredicate(expectedPredicate, resultPredicate: predicate)
         count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
         XCTAssertEqual(3, count, "Count mismatch")
         
         predicate = NSPredicate.predicateBuilder("type", value: fireType, predicateOperator: .Equal)
         expectedPredicate = NSPredicate(format: "type == %@", fireType)
-        checkPreficate(expectedPredicate, resultPredicate: predicate)
+        checkPredicate(expectedPredicate, resultPredicate: predicate)
 
         count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
         XCTAssertEqual(3, count, "Count mismatch")

        let fireType = PokemonFactory.createType(managedObjectContext, id: .Fire, name: .Fire)
        var predicate = NSPredicate.predicateBuilder("level", value: 16, predicateOperator: .LessThan)
        var expectedPredicate = NSPredicate(format: "level < 16")
        checkPreficate(expectedPredicate, resultPredicate: predicate)
        var count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
        XCTAssertEqual(3, count, "Count mismatch")
        
        predicate = NSPredicate.predicateBuilder("level", value: 16, predicateOperator: .LessThanOrEqual)
        expectedPredicate = NSPredicate(format: "level <= 16")
        checkPreficate(expectedPredicate, resultPredicate: predicate)
        count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
        XCTAssertEqual(6, count, "Count mismatch")
    }

    
    private func checkPreficate(expectedPredicate : NSPredicate?, resultPredicate: NSPredicate?){
        XCTAssertNotNil(expectedPredicate, "Shouldn't be nil")
        XCTAssertNotNil(resultPredicate, "Shouldn't be nil")
        XCTAssertEqual(expectedPredicate!, resultPredicate!, "Predicates mismatch")

        var count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
        XCTAssertEqual(8, count, "Count mismatch")
        
        checkPredicate(expectedPredicate, resultPredicate: predicate)
        
        predicate = NSPredicate.predicateBuilder("level", value: 1, predicateOperator: .NotEqual)
        expectedPredicate = NSPredicate(format: "level != 1")
        checkPredicate(expectedPredicate, resultPredicate: predicate)
        count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
        XCTAssertEqual(6, count, "Count mismatch")
        
        predicate = NSPredicate.predicateBuilder("type", value: fireType, predicateOperator: .NotEqual)
        expectedPredicate = NSPredicate(format: "type != %@", fireType)
        checkPredicate(expectedPredicate, resultPredicate: predicate)
        count = Pokemon.count(context: managedObjectContext, predicate: predicate, error: nil)
        XCTAssertEqual(6, count, "Count mismatch")
        
