Edward, welcome to
Java Ranch!
Try storing the result of the function in a variable and then using an expression to determine if the value is in range. Something like this:
I could be more specific if you were using
JUnit, but I don't know what facilities BlueJ provides for testing.