@Test
public void testStopObservingOwner_onDestroy() {

    Observer<String> observer = (Observer<String>) mock(Observer.class);
    mRegistry.handleLifecycleEvent(ON_CREATE);
    mLiveData.observe(mOwner, observer);
    assertThat(mRegistry.getObserverCount(), is(1));
    mRegistry.handleLifecycleEvent(ON_DESTROY);
    assertThat(mRegistry.getObserverCount(), is(0));
}