Suppose in a class I have a dependency on java.util.Random class. Since random is a concrete class and not backed by an interface, how can I mock the dependency? Should I extend the random class and override the methods.
I was initially using Math.random() but since it was a static method, what can I do to mock it? How do I mock static method for unit testing.