ObservableScrollView extends ScrollView { @Override protected void onScrollChanged(int currentX, int currentY, int oldX, int oldY) { super.onScrollChanged(currentX, currentY, oldX, oldY); if (scrollViewListener != null) { scrollViewListener.onScrollChanged(currentY); } } ObservableScrollView(Context context);  ObservableScrollView(Context context, AttributeSet attrs);  ObservableScrollView(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  ObservableScrollView(Context context, AttributeSet attrs, int defStyleAttr, int
            defStyleRes); void setScrollViewListener(ScrollViewListener scrollViewListener);  }
@Test public void testOnScrollChanged() { final ObservableScrollView scrollView = new ObservableScrollView(RuntimeEnvironment.application); final ObservableScrollView.ScrollViewListener listener = mock(ObservableScrollView.ScrollViewListener.class); scrollView.setScrollViewListener(listener); scrollView.onScrollChanged(0, TEST_SCROLL_X, 0, 0); verify(listener).onScrollChanged(TEST_SCROLL_X); }