you assign max integer value to long,

Shouldn't it be Long.MAX_VALUE ?