SwipeLayout extends FrameLayout { public void anchor(Integer... points) { makeSureOrientationStrategy(); orientationStrategy.setAnchor(points); } 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 whenSetAnchor_forwardToOrientationStrategy() { Integer[] anchors = new Integer[]{9}; swipeLayout.anchor(anchors); verify(orientationStrategy).setAnchor(anchors); verifyNoMoreInteractions(orientationStrategy); }