@Test public void testSetUserVisibleHintWithoutAttachedFragmentManager() { final Fragment mockFragment = mock(Fragment.class); when(mockFragment.getFragmentManager()).thenReturn(null); PagerAdapterHelper.setUserVisibleHint(mockFragment, true); PagerAdapterHelper.setUserVisibleHint(mockFragment, false); verify(mockFragment, times(2)).getFragmentManager(); verifyNoMoreInteractions(mockFragment); }
static void setUserVisibleHint(@NonNull final Fragment fragment, final boolean visible) { final FragmentManager manager = fragment.getFragmentManager(); if (manager != null) fragment.setUserVisibleHint(visible); }
PagerAdapterHelper { static void setUserVisibleHint(@NonNull final Fragment fragment, final boolean visible) { final FragmentManager manager = fragment.getFragmentManager(); if (manager != null) fragment.setUserVisibleHint(visible); } }
PagerAdapterHelper { static void setUserVisibleHint(@NonNull final Fragment fragment, final boolean visible) { final FragmentManager manager = fragment.getFragmentManager(); if (manager != null) fragment.setUserVisibleHint(visible); } private  PagerAdapterHelper(); }
PagerAdapterHelper { static void setUserVisibleHint(@NonNull final Fragment fragment, final boolean visible) { final FragmentManager manager = fragment.getFragmentManager(); if (manager != null) fragment.setUserVisibleHint(visible); } private  PagerAdapterHelper();  }
PagerAdapterHelper { static void setUserVisibleHint(@NonNull final Fragment fragment, final boolean visible) { final FragmentManager manager = fragment.getFragmentManager(); if (manager != null) fragment.setUserVisibleHint(visible); } private  PagerAdapterHelper();   }