you can use parentFragmentManager or childFragmentManager for using fragment manager inside of a fragment. There is no need to use any sort of casting for using a fragment manager.
parentFragmentManager or getParentFragmentManager()
Return the FragmentManager for interacting with fragments associated with this fragment's activity. Note that this will available slightly before {@link #getActivity()}, during the time from when the fragment is placed in a {@link FragmentTransaction} until it is committed and attached to its activity.If this Fragment is a child of another Fragment, the FragmentManager returned here will be the parent's {@link #getChildFragmentManager()}. @throws IllegalStateException if not associated with a transaction or host.
childFragmentManager or getChildFragmentManager()
Return a private FragmentManager for placing and managing Fragments inside of this Fragment.
I just read that you are learning something new, so I suggest it is better to use the best practices. Casting sometimes generates errors and crashes, so I suggest you use these.