code: public static int maxInArray(int[] values)
      {
          if ((values == null) || (values.length == 0))
          {
              throw new IllegalArgumentException("Cannot find the max of a null or empty array.");
          }
  
          int max = values[0];
  
          for (int value : values)
          {
              max = (max < value) ? value : max;
          }
  
          return max;
      }
docs: Returns the maximum value in an array of integers.
  
  @param  values The array to find the amx in.
  
  @return The max value.