### Question:
ShoveGestureDetector extends ProgressiveGesture<ShoveGestureDetector.OnShoveGestureListener> { @Override protected boolean analyzeMovement() { super.analyzeMovement(); deltaPixelSinceLast = calculateDeltaPixelsSinceLast(); deltaPixelsSinceStart += deltaPixelSinceLast; if (isInProgress() && deltaPixelSinceLast != 0) { return listener.onShove(this, deltaPixelSinceLast, deltaPixelsSinceStart); } else if (canExecute(GESTURE_TYPE_SHOVE)) { if (listener.onShoveBegin(this)) { gestureStarted(); return true; } } return false; } ShoveGestureDetector(Context context, AndroidGesturesManager gesturesManager); float getDeltaPixelsSinceStart(); float getDeltaPixelSinceLast(); float getPixelDeltaThreshold(); void setPixelDeltaThreshold(float pixelDeltaThreshold); void setPixelDeltaThresholdResource(@DimenRes int pixelDeltaThresholdDimen); float getMaxShoveAngle(); void setMaxShoveAngle(float maxShoveAngle);  }### Answer:
@Test public void analyzeMovementTest() throws Exception { when(listener.onShoveBegin(gestureDetector)).thenReturn(true); when(listener.onShove(gestureDetector, gestureDetector.deltaPixelSinceLast, gestureDetector.deltaPixelsSinceStart)) .thenReturn(true); doReturn(true).when(gestureDetector).isAngleAcceptable(); doReturn(gestureDetector.getPixelDeltaThreshold() / 2) .when(gestureDetector).calculateDeltaPixelsSinceLast(); gestureDetector.analyzeMovement(); doReturn(gestureDetector.getPixelDeltaThreshold() * 2) .when(gestureDetector).calculateDeltaPixelsSinceLast(); gestureDetector.analyzeMovement(); gestureDetector.analyzeMovement(); verify(listener, times(1)).onShove(gestureDetector, gestureDetector.deltaPixelSinceLast, gestureDetector.deltaPixelsSinceStart); doReturn(gestureDetector.getPixelDeltaThreshold() / 2) .when(gestureDetector).calculateDeltaPixelsSinceLast(); gestureDetector.analyzeMovement(); verify(listener, times(1)).onShove(gestureDetector, gestureDetector.deltaPixelSinceLast, gestureDetector.deltaPixelsSinceStart); doReturn(false) .when(gestureDetector).isAngleAcceptable(); gestureDetector.analyzeMovement(); doReturn(true) .when(gestureDetector).isAngleAcceptable(); gestureDetector.analyzeMovement(); verify(listener, times(1)).onShove(gestureDetector, gestureDetector.deltaPixelSinceLast, gestureDetector.deltaPixelsSinceStart); gestureDetector.gestureStopped(); gestureDetector.analyzeMovement(); doReturn(gestureDetector.getPixelDeltaThreshold() * 2) .when(gestureDetector).calculateDeltaPixelsSinceLast(); gestureDetector.analyzeMovement(); verify(listener, times(2)).onShoveBegin(gestureDetector); verify(listener, times(1)).onShoveEnd( gestureDetector, gestureDetector.velocityX, gestureDetector.velocityY); }