UiObjectMatcher { public UiSelector getUiSelector() { return mUiSelector; } UiObjectMatcher(UiSelector uiSelector, BySelector bySelector); static UiObjectMatcher withTextStartingWith(String text); static UiObjectMatcher withTextStartingWith(String text, Class klass); static UiObjectMatcher withTextContaining(String text); static UiObjectMatcher withTextContaining(String text, Class klass); static UiObjectMatcher withText(String text); static UiObjectMatcher withText(String text, Class klass); static UiObjectMatcher withContentDescription(String text); static UiObjectMatcher withContentDescription(String text, Class klass); static UiObjectMatcher withResourceId(String id); static UiObjectMatcher withResourceId(String id, Class klass); static UiObjectMatcher withClass(Class klass); UiObjectMatcher childMatcher(UiObjectMatcher childMatcher); UiObjectMatcher instance(int instance); UiSelector getUiSelector(); UiObject getUiObject(UiDevice device); BySelector getBySelector();  }
@Test public void getUiSelector() { UiObjectMatcher matcher = UiObjectMatcher.withClass(LinearLayout.class); assertEquals("UiSelector[CLASS=android.widget.LinearLayout]", matcher.getUiSelector().toString()); }