### Question:
ScrollAnimator { public void configureListView(ListView listView) { this.listView = listView; this.listView.setOnScrollListener(new OnScrollListener() { int scrollPosition; @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { notifyScrollToAdditionalScrollListener(view, firstVisibleItem, visibleItemCount, totalItemCount); View topChild = view.getChildAt(0); int newScrollPosition; if (topChild == null) { newScrollPosition = 0; } else { newScrollPosition = view.getFirstVisiblePosition() * topChild.getHeight() - topChild.getTop(); } if (Math.abs(newScrollPosition - scrollPosition) >= SCROLL_DIRECTION_CHANGE_THRESHOLD) { onScrollPositionChanged(scrollPosition, newScrollPosition); } scrollPosition = newScrollPosition; } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { notifyScrollStateChangedToAdditionalScrollListener(view, scrollState); } }); } ScrollAnimator(View animatedView, ObjectAnimatorFactory objectAnimatorFactory); void setAdditionalScrollListener(OnScrollListener additionalScrollListener); void configureListView(ListView listView); void setDurationInMillis(long duration); void release(); void showWithAnimation(); void showWithAnimationWithListener(Animator.AnimatorListener animatorListener); void hideWithAnimation(); void hideWithAnimationWithListener(Animator.AnimatorListener animatorListener);  }### Answer:
@Test public void shouldShowViewOnScrollToBottomAndThenToTop() { scrollAnimator.configureListView(listView); scrollToBottom(); scrollToTop(); verify(objectAnimatorFactory).getObjectAnimator(animatedView, ANIMATION_TYPE_TRANSLATION_Y, 0); }
@Test public void shouldHideViewOnScrollToBottom() { scrollAnimator.configureListView(listView); scrollToBottom(); verify(objectAnimatorFactory).getObjectAnimator(animatedView, ANIMATION_TYPE_TRANSLATION_Y, SHOW_Y_POSITION); }