### Question:
MoveGestureDetector extends ProgressiveGesture<MoveGestureDetector.OnMoveGestureListener> { @Override protected boolean analyzeEvent(@NonNull MotionEvent motionEvent) { switch (motionEvent.getActionMasked()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_POINTER_DOWN: resetFocal = true; float x = motionEvent.getX(motionEvent.getActionIndex()); float y = motionEvent.getY(motionEvent.getActionIndex()); moveDistancesObjectMap.put( motionEvent.getPointerId(motionEvent.getActionIndex()), new MoveDistancesObject(x, y) ); break; case MotionEvent.ACTION_UP: moveDistancesObjectMap.clear(); break; case MotionEvent.ACTION_POINTER_UP: resetFocal = true; moveDistancesObjectMap.remove(motionEvent.getPointerId(motionEvent.getActionIndex())); break; case MotionEvent.ACTION_CANCEL: moveDistancesObjectMap.clear(); break; default: break; } return super.analyzeEvent(motionEvent); } MoveGestureDetector(Context context, AndroidGesturesManager gesturesManager); float getMoveThreshold(); void setMoveThreshold(float moveThreshold); @Nullable RectF getMoveThresholdRect(); void setMoveThresholdRect(@Nullable RectF moveThresholdRect); void setMoveThresholdResource(@DimenRes int moveThresholdDimen); float getLastDistanceX(); float getLastDistanceY(); MoveDistancesObject getMoveObject(int pointerIndex);  }### Answer:
@Test public void analyzeEventTest() { doReturn(true).when(listener).onMoveBegin(gestureDetector); doReturn(true).when(gestureDetector).checkAnyMoveAboveThreshold(); doReturn(true).when(gestureDetector).checkPressure(); doReturn(false).when(gestureDetector).isSloppyGesture(); MotionEvent downEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_DOWN, 100, 100, null); gestureDetector.onTouchEvent(downEvent); MotionEvent moveEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_MOVE, 105, 100, downEvent); gestureDetector.onTouchEvent(moveEvent); verify(listener, times(1)).onMoveBegin(gestureDetector); moveEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_MOVE, 110, 100, moveEvent); gestureDetector.onTouchEvent(moveEvent); verify(listener, times(1)).onMove( gestureDetector, gestureDetector.lastDistanceX, gestureDetector.lastDistanceY); MotionEvent pointerDownEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_POINTER_DOWN, 200, 100, moveEvent); gestureDetector.onTouchEvent(pointerDownEvent); moveEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_MOVE, 115, 100, pointerDownEvent); gestureDetector.onTouchEvent(moveEvent); verify(listener, times(1)).onMove(gestureDetector, 0, 0); MotionEvent pointerUpEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_POINTER_UP, 200, 100, moveEvent); gestureDetector.onTouchEvent(pointerUpEvent); MotionEvent upEvent = TestUtils.INSTANCE.getMotionEvent(MotionEvent.ACTION_POINTER_UP, 200, 100, pointerUpEvent); gestureDetector.onTouchEvent(upEvent); verify(listener, times(1)).onMoveEnd( gestureDetector, gestureDetector.velocityX, gestureDetector.velocityY ); }