Simulate fork

Hello team!

I am developing tests in Java, but there is one test case that I cannot simulate: forks.

How can I simulate them? My contract can be seriously affected by them and I need to test that everything is correct.

Thank you!