SwipeLayout extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent event) { makeSureOrientationStrategy(); boolean handled = orientationStrategy.onTouchEvent(event); if (!handled) { super.onTouchEvent(event); } return true; } SwipeLayout(Context context);  SwipeLayout(Context context, AttributeSet attrs);  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); void setOrientation(Orientation orientation); void setOrientation(OrientationStrategyFactory factory); void startWith(int position); void anchor(Integer... points); void setOnTranslateChangeListener(OnTranslateChangeListener listener); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override boolean onTouchEvent(MotionEvent event); void translateTo(int position);  }
@Test public void whenOnTouchEvent_forwardToOrientationStrategy() { MotionEvent event = mock(MotionEvent.class); swipeLayout.onTouchEvent(event); verify(orientationStrategy).onTouchEvent(event); verifyNoMoreInteractions(orientationStrategy); }