class AndroidMocks {

    @SuppressLint("NewApi")
    public static ViewPropertyAnimator mockViewPropertyAnimator() {
        ViewPropertyAnimator animator = mock(ViewPropertyAnimator.class);
        when(animator.alpha(anyFloat())).thenReturn(animator);
        when(animator.alphaBy(anyFloat())).thenReturn(animator);
        when(animator.rotation(anyFloat())).thenReturn(animator);
        when(animator.rotationBy(anyFloat())).thenReturn(animator);
        when(animator.rotationX(anyFloat())).thenReturn(animator);
        when(animator.rotationXBy(anyFloat())).thenReturn(animator);
        when(animator.rotationY(anyFloat())).thenReturn(animator);
        when(animator.rotationYBy(anyFloat())).thenReturn(animator);
        when(animator.translationX(anyFloat())).thenReturn(animator);
        when(animator.translationXBy(anyFloat())).thenReturn(animator);
        when(animator.translationY(anyFloat())).thenReturn(animator);
        when(animator.translationYBy(anyFloat())).thenReturn(animator);
        when(animator.translationZ(anyFloat())).thenReturn(animator);
        when(animator.translationZBy(anyFloat())).thenReturn(animator);
        when(animator.setDuration(anyLong())).thenReturn(animator);
        return animator;
    }

}