   }
 }
 
-class EarlGrey: NSObject {
+open class EarlGrey: NSObject {
   open class func select(elementWithMatcher matcher:GREYMatcher,
                            file: String = #file,
                            line: UInt = #line) -> GREYElementInteraction {

import EarlGrey
import Foundation

open func GREYAssert(_ expression: @autoclosure () -> Bool, reason: String) {
  GREYAssert(expression, reason, details: "Expected expression to be true")
}

open func GREYAssertTrue(_ expression: @autoclosure () -> Bool, reason: String) {
  GREYAssert(expression(), reason, details: "Expected the boolean expression to be true")
}

open func GREYAssertFalse(_ expression: @autoclosure () -> Bool, reason: String) {
  GREYAssert(!expression(), reason, details: "Expected the boolean expression to be false")
}

open func GREYAssertNotNil(_ expression: @autoclosure ()-> Any?, reason: String) {
  GREYAssert(expression() != nil, reason, details: "Expected expression to be not nil")
}

open func GREYAssertNil(_ expression: @autoclosure () -> Any?, reason: String) {
  GREYAssert(expression() == nil, reason, details: "Expected expression to be nil")
}

open func GREYAssertEqual(_ left: @autoclosure () -> AnyObject?,
                            _ right: @autoclosure () -> AnyObject?, reason: String) {
  GREYAssert(left() === right(), reason, details: "Expected left term to be equal to right term")
}

open func GREYAssertNotEqual(_ left: @autoclosure () -> AnyObject?,
                               _ right: @autoclosure () -> AnyObject?, reason: String) {
  GREYAssert(left() !== right(), reason, details: "Expected left term to not equal the right term")
}

open func GREYAssertEqualObjects<T: Equatable>( _ left: @autoclosure () -> T?,
                                                  _ right: @autoclosure () -> T?, reason: String) {
  GREYAssert(left() == right(), reason, details: "Expected object of the left term to be equal" +
    " to the object of the right term")
}

open func GREYAssertNotEqualObjects<T: Equatable>( _ left: @autoclosure () -> T?,
                                      _ right: @autoclosure () -> T?, reason: String) {
  GREYAssert(left() != right(), reason, details: "Expected object of the left term to not" +
    " equal the object of the right term")
}

open func GREYFail(_ reason: String) {
  EarlGrey.handle(exception: GREYFrameworkException(name: kGREYAssertionFailedException,
                                                    reason: reason),
                  details: "")
}

open func GREYFailWithDetails(_ reason: String, details: String) {
  EarlGrey.handle(exception: GREYFrameworkException(name: kGREYAssertionFailedException,
                                                    reason: reason),
                  details: details)

}

extension GREYInteraction {
  @discardableResult public func assert(_ matcher: @autoclosure () -> GREYMatcher) -> Self {
    return self.assert(with:matcher())
  }

  @discardableResult public func assert(_ matcher: @autoclosure () -> GREYMatcher,
                                        error:UnsafeMutablePointer<NSError?>!) -> Self {
    return self.assert(with: matcher(), error: error)
  }

  @discardableResult public func using(searchAction: GREYAction,
                                       onElementWithMatcher matcher: GREYMatcher) -> Self {
    return self.usingSearch(searchAction, onElementWith: matcher)
  }
