Improve Coin range check to cope with Long.MIN_VALUE correctly

The use of Math.abs() in the existing check doesn't work for Long.MIN_VALUE. Added alternate check and a test case.