### Question:
FragmentLifebus extends BaseLifebus<Fragment, FragmentEvent> { @NonNull public static Lifebus<FragmentEvent> create(@NonNull Fragment fragment) { final FragmentManager manager = fragment.getFragmentManager(); if (manager == null) { throw new IllegalStateException("Provided fragment '" + fragment.getClass().getName() + "' " + "is not attached to a fragment manager. Consider using #create(FragmentManager, Fragment) " + "factory method or wait until fragment is attached"); } return new Impl(manager, fragment); } protected  FragmentLifebus(@NonNull Fragment owner, @NonNull Class<FragmentEvent> event, @NonNull FragmentEvent disposeEvent); @NonNull static Lifebus<FragmentEvent> create(@NonNull Fragment fragment); @NonNull static Lifebus<FragmentEvent> create(@NonNull FragmentManager manager, @NonNull Fragment fragment);  }### Answer:
@Test public void create_no_manager() { try { FragmentLifebus.create(mock(Fragment.class)); fail(); } catch (IllegalStateException e) { assertTrue(e.getMessage(), e.getMessage().startsWith("Provided fragment ")); } }
@Test public void create_with_manager_registers_callbacks() { final Fragment fragment = mock(Fragment.class); final FragmentManager manager = mock(FragmentManager.class); FragmentLifebus.create(manager, fragment); verify(manager, times(1)) .registerFragmentLifecycleCallbacks(any(FragmentManager.FragmentLifecycleCallbacks.class), anyBoolean()); }