This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
You don't mock an object that is being created within a method. The only way to do that would be to modify the actual byte code with a library such as BCEL or ASM, replacing the byte code instructions for "B b = new B()" with something else.
A much more viable option is to expose "B" so that you can indeed swap in a test double. For example, you could do something like this: