There may be an easier way to do this, but this should work:
1) Step B (F5) is the method for which you want to change the return value. This is normal if you do not have the source code for this method, and it is included in the class file.
2) Open the View window (Window> Show View> Show) and enter true in it
3) Highlight the true that you just typed, and right-click on it and select "Force Return" (or Alt + Shift + F)
4) Continue to execute your code. If you have an if statement configured as in your question, now it should go to the if block.
source share