SI-7006 Fix the unreachable test

The unreachable test was missing the cases when Random.nextInt returned
a negative number. This commit fixes that.
Merge pull request #2217 from JamesIry/master_7006b

SI-7006 Fix the unreachable test