Utilities.getDistance(uni, enemyuni) <= uni.getAttackRange()
Utilities.getDistance returns double and getAttackRange returns int. The above code
This should be fine. In floating point operation/comparisons, if one argument is floating/double then other one being int is also promoted to the same.