ActionBarFragment extends BaseFragment { @Override public void onCreate(@Nullable final Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (annotationHandler != null) { final ActionBarFragmentAnnotationHandler annotationHandler = (ActionBarFragmentAnnotationHandler) this.annotationHandler; if (annotationHandler.hasOptionsMenu()) { setHasOptionsMenu(true); } } }  @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 testOnCreate() { final FragmentActivity activity = Robolectric.buildActivity(TestCompatActivity.class).create().start().resume().get(); final FragmentManager fragmentManager = activity.getSupportFragmentManager(); final ActionBarFragment fragment = new TestFragment(); fragmentManager.beginTransaction().add(fragment, null).commit(); fragmentManager.executePendingTransactions(); }