@Test public void singleMethod() { CreatedStateListener obj = mock(CreatedStateListener.class); ReflectiveGenericLifecycleObserver observer = new ReflectiveGenericLifecycleObserver(obj); when(mLifecycle.getCurrentState()).thenReturn(CREATED); observer.onStateChanged(mOwner, ON_CREATE); verify(obj).onCreated(); verify(obj).onCreated(mOwner); }
@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);  }