@Test public void testValidSuper1() { DerivedClass2 obj = mock(DerivedClass2.class); ReflectiveGenericLifecycleObserver observer = new ReflectiveGenericLifecycleObserver(obj); observer.onStateChanged(mock(LifecycleOwner.class), ON_START); verify(obj).foo(Matchers.<LifecycleOwner>any()); verify(obj, never()).foo(); reset(obj); observer.onStateChanged(mock(LifecycleOwner.class), ON_STOP); verify(obj).foo(); verify(obj, never()).foo(Matchers.<LifecycleOwner>any()); }
@Override public void onStateChanged(LifecycleOwner source, Event event) { mInfo.invokeCallbacks(source, event, mWrapped); }
ReflectiveGenericLifecycleObserver implements GenericLifecycleObserver { @Override public void onStateChanged(LifecycleOwner source, Event event) { mInfo.invokeCallbacks(source, event, mWrapped); } }
ReflectiveGenericLifecycleObserver implements GenericLifecycleObserver { @Override public void onStateChanged(LifecycleOwner source, Event event) { mInfo.invokeCallbacks(source, event, mWrapped); } ReflectiveGenericLifecycleObserver(Object wrapped); }
ReflectiveGenericLifecycleObserver implements GenericLifecycleObserver { @Override public void onStateChanged(LifecycleOwner source, Event event) { mInfo.invokeCallbacks(source, event, mWrapped); } ReflectiveGenericLifecycleObserver(Object wrapped); @Override void onStateChanged(LifecycleOwner source, Event event); }
ReflectiveGenericLifecycleObserver implements GenericLifecycleObserver { @Override public void onStateChanged(LifecycleOwner source, Event event) { mInfo.invokeCallbacks(source, event, mWrapped); } ReflectiveGenericLifecycleObserver(Object wrapped); @Override void onStateChanged(LifecycleOwner source, Event event);  }