AutomatorAction { public static AutomatorAction swipeRight(final int steps) { return new AutomatorAction() { @Override public void wrappedPerform(UiSelector selector, UiObject object) throws UiObjectNotFoundException { object.swipeRight(steps); } }; }  static AutomatorAction click(); static AutomatorAction check(final boolean check); static AutomatorAction setText(final String text); static AutomatorAction clearTextField(); static AutomatorAction swipeRight(final int steps); static AutomatorAction swipeLeft(final int steps); static AutomatorAction scrollTextIntoView(final String text); abstract void wrappedPerform(UiSelector selector, UiObject object);  }
@Test public void swipeRight() throws UiObjectNotFoundException { UiObject object = mock(UiObject.class); AutomatorAction.swipeRight(5).perform(null, object); verify(object).swipeRight(5); }