Java maxValue script