fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTests.java
@Test
    public void hideUnAdded() throws Throwable {
        FragmentTestUtil.setContentView(mActivityRule, R.layout.simple_container);
        final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
        final StrictViewFragment fragment = new StrictViewFragment();
        fm.beginTransaction()
                .hide(fragment)
                .commit();
        FragmentTestUtil.executePendingTransactions(mActivityRule);
    }
// Hiding a non-existing fragment should not throw
Hiding a non-existing fragment should not throw
Hiding a non - existing fragment should not throw
@Test
    public void hideUnAdded() throws Throwable {
        FragmentTestUtil.setContentView(mActivityRule, R.layout.simple_container);
        final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
        final StrictViewFragment fragment = new StrictViewFragment();
        fm.beginTransaction()
                .hide(fragment)
                .commit();
        FragmentTestUtil.executePendingTransactions(mActivityRule);
    }
@ Test public void hideUnAdded ( ) throws Throwable { FragmentTestUtil . setContentView ( mActivityRule , R . layout . simple_container ) ; final FragmentManager fm = mActivityRule . getActivity ( ) . getSupportFragmentManager ( ) ; final StrictViewFragment fragment = new StrictViewFragment ( ) ; fm . beginTransaction ( ) . hide ( fragment ) . commit ( ) ; FragmentTestUtil . executePendingTransactions ( mActivityRule ) ; }
Hiding a non-existing fragment should not throw
Hiding a non - existing fragment should not throw