I want to test a few things and want to directly get a registered bean. How do I get a handle to the bean factory?

Thanks

P.S: I know this is a bad thing to do and discouraged, I just want to understand a few things deeper