FragmentPlugin extends AbstractPlugin<Fragment, FragmentDelegate> { public void onCreate(@Nullable Bundle savedInstanceState) { verifyMethodCalledFromDelegate("onCreate(Bundle)"); ((CallVoid1<Bundle>) mSuperListeners.pop()).call(savedInstanceState); }  void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args); boolean getAllowEnterTransitionOverlap(); void setAllowEnterTransitionOverlap(boolean allow); boolean getAllowReturnTransitionOverlap(); void setAllowReturnTransitionOverlap(boolean allow); Context getContext(); Object getEnterTransition(); void setEnterTransition(@Nullable Object transition); Object getExitTransition(); void setExitTransition(@Nullable Object transition); Fragment getFragment(); LayoutInflater getLayoutInflater(@Nullable Bundle savedFragmentState); android.arch.lifecycle.Lifecycle getLifecycle(); LoaderManager getLoaderManager(); Object getReenterTransition(); void setReenterTransition(@Nullable Object transition); Object getReturnTransition(); void setReturnTransition(@Nullable Object transition); Object getSharedElementEnterTransition(); void setSharedElementEnterTransition(@Nullable Object transition); Object getSharedElementReturnTransition(); void setSharedElementReturnTransition(@Nullable Object transition); boolean getUserVisibleHint(); void setUserVisibleHint(boolean isVisibleToUser); View getView(); android.arch.lifecycle.LifecycleOwner getViewLifecycleOwner(); LiveData<android.arch.lifecycle.LifecycleOwner> getViewLifecycleOwnerLiveData(); ViewModelStore getViewModelStore(); void onActivityCreated(@Nullable Bundle savedInstanceState); void onActivityResult(int requestCode, int resultCode, Intent data); void onAttach(Context context); void onAttach(Activity activity); void onAttachFragment(Fragment childFragment); void onConfigurationChanged(Configuration newConfig); boolean onContextItemSelected(MenuItem item); void onCreate(@Nullable Bundle savedInstanceState); Animation onCreateAnimation(int transit, boolean enter, int nextAnim); Animator onCreateAnimator(int transit, boolean enter, int nextAnim); void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo); void onCreateOptionsMenu(Menu menu, MenuInflater inflater); View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
            @Nullable Bundle savedInstanceState); void onDestroy(); void onDestroyOptionsMenu(); void onDestroyView(); void onDetach(); LayoutInflater onGetLayoutInflater(@Nullable Bundle savedInstanceState); void onHiddenChanged(boolean hidden); void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState); void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState); void onLowMemory(); void onMultiWindowModeChanged(boolean isInMultiWindowMode); boolean onOptionsItemSelected(MenuItem item); void onOptionsMenuClosed(Menu menu); void onPause(); void onPictureInPictureModeChanged(boolean isInPictureInPictureMode); void onPrepareOptionsMenu(Menu menu); void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
            @NonNull int[] grantResults); void onResume(); void onSaveInstanceState(@NonNull Bundle outState); void onStart(); void onStop(); void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState); void onViewStateRestored(@Nullable Bundle savedInstanceState); void postponeEnterTransition(); void registerForContextMenu(View view); void setArguments(@Nullable Bundle args); void setEnterSharedElementCallback(SharedElementCallback callback); void setExitSharedElementCallback(SharedElementCallback callback); void setHasOptionsMenu(boolean hasMenu); void setInitialSavedState(@Nullable Fragment.SavedState state); void setMenuVisibility(boolean menuVisible); void setRetainInstance(boolean retain); void setTargetFragment(@Nullable Fragment fragment, int requestCode); boolean shouldShowRequestPermissionRationale(@NonNull String permission); void startActivity(Intent intent); void startActivity(Intent intent, @Nullable Bundle options); void startActivityForResult(Intent intent, int requestCode); void startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options); void startIntentSenderForResult(IntentSender intent, int requestCode, @Nullable Intent fillInIntent,
            int flagsMask, int flagsValues, int extraFlags, Bundle options); void startPostponedEnterTransition(); String toString(); void unregisterForContextMenu(View view);  }
@Test public void testCallBaseMethod() throws Exception { final TestFragment testFragment = new TestFragment(); assertThat(testFragment.mPlugin.mGotCalled).isFalse(); testFragment.onCreate(null); assertThat(testFragment.mPlugin.mGotCalled).isTrue(); final TestDialogFragment testDialogFragment = new TestDialogFragment(); assertThat(testDialogFragment.mPlugin.mGotCalled).isFalse(); assertThat(testDialogFragment.mDialogPlugin.mGotCalled).isFalse(); testDialogFragment.onCreate(null); assertThat(testDialogFragment.mPlugin.mGotCalled).isTrue(); assertThat(testDialogFragment.mDialogPlugin.mGotCalled).isTrue(); }