@Test public void testInvalidateOptionsMenuWhenHidden() {

	// Arrange:
	final FragmentActivity activity = Robolectric.buildActivity(TestCompatActivity.class).create().start().resume().get();
	final FragmentManager fragmentManager = activity.getSupportFragmentManager();
	final BaseFragment fragment = new TestFragment();
	fragmentManager.beginTransaction().add(fragment, null).commit();
	fragmentManager.executePendingTransactions();
	fragmentManager.beginTransaction().hide(fragment).commit();
	fragmentManager.executePendingTransactions();
	// Act + Assert:
	assertThat(fragment.invalidateOptionsMenu(), is(false));
}