Find minimum and maximum values in a java array