Java Integer Minimum Value Of A Function