How can I find out if code is running inside a JUnit test or not?

In my code I need to do certain fixes only when it is run inside a JUnit test. How can I find out if code is running inside a JUnit test or not? Is there something like JUnit.isRunning() == true ?

How can I find out if code is running inside a JUnit test or not?