// Path: lib/src/main/java/com/mindbodyonline/ironhide/Infrastructure/Extensions/TextViewMatchers.java
// public class TextViewMatchers {
// 
//     /**
//      * Checks to see if a TextView's text is empty or null.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyOrNullString() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getText() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty or null string");
//             }
//         };
//     }
// 
//     /**
//      * Checks to see if a TextView's text is empty.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyString() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getText() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty string");
//             }
//         };
//     }
// 
//     // Hint matchers
// 
// 
//     /**
//      * Checks to see if a TextView's hint text is empty or null.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyOrNullHint() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getHint() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty or null string");
//             }
//         };
//     }
// 
//     /**
//      * Checks to see if a TextView's hint text is empty.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyHint() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getHint() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty string");
//             }
//         };
//     }
// }
// 
// Path: lib/src/main/java/com/mindbodyonline/ironhide/PageObjects/PageObject.java
// public class PageObject {
// 
//     public static final int DEFAULT_PAUSE_TIME = 2000;
// 
//     /**
//      * Pause the test run for {@link PageObject#DEFAULT_PAUSE_TIME} milliseconds
//      * @return A generic of the passed in type
//      */
//     public <T extends PageObject> T pause(Class<T> type) {
//         return pause(type, DEFAULT_PAUSE_TIME);
//     }
// 
//     /**
//      * Pause the test run for a given amount of time(in milliseconds).
//      * @param timeInMillis Time, in milliseconds, to pause for.
//      * @return A generic of the passed in type.                     
//      */
//     public <T extends PageObject> T pause(Class<T> type, int timeInMillis) {
//         try {
//             Thread.sleep(timeInMillis);
//             return type.newInstance();
//         } catch (InstantiationException | IllegalAccessException | InterruptedException e) {
//             e.printStackTrace();
//         }
//         return null;
//     }
// }


import android.support.test.espresso.Root;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.view.View;
import com.mindbodyonline.ironhide.Infrastructure.Extensions.TextViewMatchers;
import com.mindbodyonline.ironhide.PageObjects.PageObject;
import org.hamcrest.Matcher;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace;
import static org.hamcrest.Matchers.startsWith;
        return withHintText(endsWith(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is equal to (ignoring case) a certain string given the string's resource id.
     *
     * @param resourceId The string's resource id
     * @return The model reached by interacting with this element.
     */
    public T hintEqualToIgnoringCase(int resourceId) {
        return withHintText(equalToIgnoringCase(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is equal to (ignoring white space around words) a certain string given the string's resource id.
     *
     * @param resourceId The string's resource id
     * @return The model reached by interacting with this element.
     */
    public T hintEqualToIgnoringWhiteSpace(int resourceId) {
        return withHintText(equalToIgnoringWhiteSpace(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is empty or null.
     * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
     *
     * @return The model reached by interacting with this element.
     */
    public T isEmptyOrNullHint() {
// Path: lib/src/main/java/com/mindbodyonline/ironhide/Infrastructure/Extensions/TextViewMatchers.java
// public class TextViewMatchers {
// 
//     /**
//      * Checks to see if a TextView's text is empty or null.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyOrNullString() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getText() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty or null string");
//             }
//         };
//     }
// 
//     /**
//      * Checks to see if a TextView's text is empty.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyString() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getText() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty string");
//             }
//         };
//     }
// 
//     // Hint matchers
// 
// 
//     /**
//      * Checks to see if a TextView's hint text is empty or null.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyOrNullHint() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getHint() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty or null string");
//             }
//         };
//     }
// 
//     /**
//      * Checks to see if a TextView's hint text is empty.
//      * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
//      * @return  A Matcher to check using Espresso ViewAssertions.matches method
//      */
//     public static Matcher<View> isEmptyHint() {
//         return new BoundedMatcher<View, TextView>(TextView.class) {
//             @Override
//             protected boolean matchesSafely(TextView textView) {
//                 return textView != null
//                         && (textView.getHint() == null || textView.getText().length() == 0);
//             }
// 
//             @Override
//             public void describeTo(Description description) {
//                 description.appendText("with text empty string");
//             }
//         };
//     }
// }
// 
// Path: lib/src/main/java/com/mindbodyonline/ironhide/PageObjects/PageObject.java
// public class PageObject {
// 
//     public static final int DEFAULT_PAUSE_TIME = 2000;
// 
//     /**
//      * Pause the test run for {@link PageObject#DEFAULT_PAUSE_TIME} milliseconds
//      * @return A generic of the passed in type
//      */
//     public <T extends PageObject> T pause(Class<T> type) {
//         return pause(type, DEFAULT_PAUSE_TIME);
//     }
// 
//     /**
//      * Pause the test run for a given amount of time(in milliseconds).
//      * @param timeInMillis Time, in milliseconds, to pause for.
//      * @return A generic of the passed in type.                     
//      */
//     public <T extends PageObject> T pause(Class<T> type, int timeInMillis) {
//         try {
//             Thread.sleep(timeInMillis);
//             return type.newInstance();
//         } catch (InstantiationException | IllegalAccessException | InterruptedException e) {
//             e.printStackTrace();
//         }
//         return null;
//     }
// }


// Path: lib/src/main/java/com/mindbodyonline/ironhide/Infrastructure/IronhideViews/TextField.java
import android.support.test.espresso.Root;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.view.View;
import com.mindbodyonline.ironhide.Infrastructure.Extensions.TextViewMatchers;
import com.mindbodyonline.ironhide.PageObjects.PageObject;
import org.hamcrest.Matcher;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace;
import static org.hamcrest.Matchers.startsWith;

        return withHintText(endsWith(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is equal to (ignoring case) a certain string given the string's resource id.
     *
     * @param resourceId The string's resource id
     * @return The model reached by interacting with this element.
     */
    public T hintEqualToIgnoringCase(int resourceId) {
        return withHintText(equalToIgnoringCase(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is equal to (ignoring white space around words) a certain string given the string's resource id.
     *
     * @param resourceId The string's resource id
     * @return The model reached by interacting with this element.
     */
    public T hintEqualToIgnoringWhiteSpace(int resourceId) {
        return withHintText(equalToIgnoringWhiteSpace(fromId(resourceId)));
    }

    /**
     * Checks to see if a TextView's text is empty or null.
     * NOTE: see issue 72 for Espresso (https://code.google.com/p/android-test-kit/issues/detail?id=72)
     *
     * @return The model reached by interacting with this element.
     */
    public T isEmptyOrNullHint() {
        return checkMatches(TextViewMatchers.isEmptyOrNullHint());