         XCTAssertTrue(collection.contains(value))
       }
     }
-
+    
     do {
       let dictionary = [1, 2, 3]
       var foundFirst = false
       var foundSecond = false
       var foundThird = false
-
+      
       repeat {
         let randomElement = dictionary.random()
         
         if randomElement == 1 {
           foundFirst = true
-
+          
         } else if randomElement == 2 {
           foundSecond = true
         } else if randomElement == 3 {
           foundThird = true
         }
-
+        
       } while foundFirst == false || foundSecond == false || foundThird == false
     }
   }
-
+  
+  func testUniqueElement() {
+    
+    do {
+      let array = [1, 2, 3, 4, 5, 3, 6, 1]
+      let uniqueArray = array.uniqueElements
+      XCTAssertTrue(uniqueArray.count == 6)
+    }
+    
+    do {
+      let array = [Int]()
+      let uniqueArray = array.uniqueElements
+      XCTAssertTrue(uniqueArray.count == 0)
+    }
+    
+    do {
+      let array = [1, 1, 1, 1, 1, 1, 1]
+      let uniqueArray = array.uniqueElements
+      XCTAssertTrue(uniqueArray.count == 1)
+    }
+    
   }
+  
+}
 
 

        XCTAssertTrue(value == 1 || value == 2)
      }
    }

    do {
      let collection = Array(repeating: 3, count: 300)
      XCTAssertTrue(collection.random() == 3)
    }

    do {
      let collection = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
      for _ in 1...100 {

@testable import Mechanica

class CollectionUtilsTests: XCTestCase {
  
  func testFirstIndex() {
    // Given
    let array = [1, 1, 1, 2, 3, 4, 4, 5, 8]
    
    // When, Then
    let index1 = array.firstIndex(of: 1)
    XCTAssertTrue(index1 == 0)
