FragmentLightCycleDispatcher implements LightCycleDispatcher<FragmentLightCycle<HostType>>, FragmentLightCycle<HostType> { @Override public void onDetach(HostType host) { for (FragmentLightCycle<HostType> component : fragmentLightCycles) { component.onDetach(host); } } FragmentLightCycleDispatcher(); @Override void bind(FragmentLightCycle<HostType> lightCycle); @Override void onAttach(HostType host, Activity activity); @Override void onAttach(HostType host, Context context); @Override void onCreate(HostType host, @Nullable Bundle bundle); @Override void onViewCreated(HostType host, View view, @Nullable Bundle savedInstanceState); @Override void onActivityCreated(HostType host, Bundle bundle); @Override void onStart(HostType host); @Override void onResume(HostType host); @Override boolean onOptionsItemSelected(HostType host, MenuItem item); @Override void onPause(HostType host); @Override void onStop(HostType host); @Override void onSaveInstanceState(HostType host, Bundle bundle); @Override void onDestroyView(HostType host); @Override void onDestroy(HostType host); @Override void onDetach(HostType host);  }
@Test public void shouldNotifyOnDetach() { dispatcher.onDetach(fragment); verify(lifeCycleComponent1).onDetach(fragment); verify(lifeCycleComponent2).onDetach(fragment); }