         removeFirstObject(object)
     }
 
-    /// EZSE: Removes the first given object
-    public mutating func removeFirstObject(_ object: Element) {
-        if let index = self.index(of: object) {
-            self.remove(at: index)
-        }
-    }
-
-    /// EZSE: Removes all occurrences of the given object
-    public mutating func removeObjects(_ object: Element) {
-        for i in self.indexes(of: object).reversed() {
-            self.remove(at: i)
-        }
-    }
-
-    /// EZSE: Checks if the main array contains the parameter array
-    @available(*, deprecated: 1.7, renamed: "contains(array:)")
-    public func containsArray(_ lookFor: [Element]) -> Bool {
-        return contains(array: lookFor)
-    }
-
-    /// EZSE: Checks if the main array contains the parameter array
-    public func contains(array lookFor: [Element]) -> Bool {
-        for item in lookFor {
-            if self.contains(item) == false {
-                return false
-            }
-        }
-        return true
-    }
-}
-
-public func ==<T: Equatable>(lhs: [T]?, rhs: [T]?) -> Bool {
-    switch (lhs, rhs) {
-    case (.some(let lhs), .some(let rhs)):
-        return lhs == rhs
-    case (.none, .none):
-        return true
-    default:
-        return false
-    }
-}
+}
+
+//MARK: - Deprecated 1.6
+
+extension Array {
+
+    /// EZSE: Iterates on each element of the array.
+    @available(*, deprecated: 1.6, renamed: "forEach(_:)")
+    public func each(_ call: (Element) -> ()) {
+        forEach(call)
+    }
+
+    /// EZSE: Creates an array with values generated by running each value of self
+    /// through the mapFunction and discarding nil return values.
+    @available(*, deprecated: 1.6, renamed: "flatMap(_:)")
+    public func mapFilter<V>(mapFunction map: (Element) -> (V)?) -> [V] {
+        return flatMap { map($0) }
+    }
+
+    /// EZSE: Iterates on each element of the array with its index.  (Index, Element)
+    @available(*, deprecated: 1.6, renamed: "forEachEnumerated(_:)")
+    public func each(_ call: @escaping (Int, Element) -> ()) {
+        forEachEnumerated(call)
+    }
+
+}

        }
        return result
    }

    /// EZSE: Removes the first given object
    @available(*, deprecated: 1.7, renamed: "removeFirstObject(_:)")

//
import UIKit

public func ==<T: Equatable>(lhs: [T]?, rhs: [T]?) -> Bool {
    switch (lhs, rhs) {
    case (.some(let lhs), .some(let rhs)):
        return lhs == rhs
    case (.none, .none):
        return true
    default:
        return false
    }
}

extension Array {

    /// EZSE: Checks if array contains at least 1 item which type is same with given element's type
    public func containsType<T>(of element: T) -> Bool {
        let elementType = type(of: element)
        return first { type(of: $0) == elementType} != nil
    }

    /// EZSE: Decompose an array to a tuple with first element and the rest
    public func decompose() -> (head: Iterator.Element, tail: SubSequence)? {
        return (count > 0) ? (self[0], self[1..<count]) : nil
    }

    /// EZSE: Iterates on each element of the array with its index. (Index, Element)
    public func forEachEnumerated(_ body: @escaping (_ offset: Int, _ element: Element) -> ()) {
        self.enumerated().forEach(body)
    }

    /// EZSE: Gets the object at the specified index, if it exists.
    public func get(at index: Int) -> Element? {
        guard index >= 0 && index < count else { return nil }
        return self[index]
    }

    /// EZSE: Prepends an object to the array.
    public mutating func insertFirst(_ newElement: Element) {
        insert(newElement, at: 0)
    }

    /// EZSE: Returns a random element from the array.
    public func random() -> Element? {
        guard count > 0 else { return nil }
        let index = Int(arc4random_uniform(UInt32(self.count)))
        return self[index]
    }

    /// EZSE: Reverse the given index. i.g.: reverseIndex(2) would be 2 to the last
