ActionBarFragment extends BaseFragment { @Override @NonNull protected ActionBarFragmentAnnotationHandler getAnnotationHandler() { FragmentAnnotations.checkIfEnabledOrThrow(); return (ActionBarFragmentAnnotationHandler) annotationHandler; }  @Override void onCreate(@Nullable final Bundle savedInstanceState); @Override void onCreateOptionsMenu(@NonNull final Menu menu, @NonNull final MenuInflater inflater); @Override void onActivityCreated(@Nullable final Bundle savedInstanceState); void invalidateActionBar();  }
@Test public void testGetAnnotationHandler() { final TestFragment fragment = new TestFragment(); assertThat(fragment.getAnnotationHandler(), is(notNullValue())); }
@Test(expected = IllegalStateException.class) public void testGetAnnotationHandlerWhenAnnotationsAreDisabled() { FragmentAnnotations.setEnabled(false); final TestFragment fragment = new TestFragment(); fragment.getAnnotationHandler(); }