how to test methods that have java probability

Please tell me how in JUnit (if possible) to test methods that have the probability of some event. I have a method that takes a String and returns a String, but when it is called, I generate a random number up to 100. And depending on what number was generated, there are 3 options for which String the method will return. Accordingly, I can't write:

@TEST
public void myMethodTest() {
String s = "какое-то сообщение";
assertEquals("ожидаемое сообщение", myMethod(s));
}

Because I don't know what exactly the method will return to me. I so I assume that I somehow have to determine this most generated number, but it is generated inside the method, I can't pass it to it. How are such methods tested?

Author: XJlAMuD, 2020-07-28