source: class RemoveViewTest {
  
    private RemoveView removeView;
    private ImageView buttonImageMock;
    private View shadowMock;
    private SimpleAnimator simpleAnimatorMockFadeIn;
    private SimpleAnimator simpleAnimatorMockFadeOut;
    private View buttonMock;
    private Context contextMock;
    private int buttonBottomPaddingTest;
  
    @Test public void testOnMoveXSmallerThanMidpoint() {
  
target:     // given
      DisplayMetrics displayMetricsMock = mock(DisplayMetrics.class);
      Resources resourcesMock = mock(Resources.class);
      doReturn(contextMock).when(buttonMock).getContext();
      doReturn(resourcesMock).when(contextMock).getResources();
      doReturn(displayMetricsMock).when(resourcesMock).getDisplayMetrics();
      displayMetricsMock.widthPixels = 400;
  
      int x = 100;
      int midpoint = displayMetricsMock.widthPixels / 2;
      int xDelta = x - midpoint;
      int xTransformed = Math.abs(xDelta * 100 / midpoint);
      int bottomPadding = buttonBottomPaddingTest - (xTransformed / 5);
  
      // when
      removeView.onMove(x, 100);
  
      // then
      verify(buttonMock).setPadding(0, 0, xTransformed, bottomPadding);
    }
  
  }