*Don't*. There is absolutely no need to mock that. There is no circumstance in which invoking that method will do anything different. Just invoke the real method. (Also: that line of code has no side effect, so there is no reason to invoke it anyway).
– Andy TurnerAug 26 '19 at 20:03
If you need to test different values coming out of that call, you'll need to pass different `String` parameters in. Mockito isn't designed to be able to change the behaviour of the JDK classes.
– Dawood ibn KareemAug 26 '19 at 20:17
Why do you need to? Parsing integer is part of your unit. Unless you somehow want to drop the dependency on the JDK, whatever that even means. So again, why would you want to do that?
– M. ProkhorovAug 27 '19 at 10:14