code: public static BigDecimal maximum(BigDecimal... values)
      {
          int len = values.length;
          if (len == 1)
          {
              if (values[0] == null)
              {
                  throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
              }
              return values[0];
          }
          BigDecimal current = values[0];
  
          for (int i=1; i < len; i++)
          {
              if (values[i] == null)
              {
                  throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
              }
              current = values[i].max(current);
          }
  
          return current;
      }
docs: Calculate the maximum value from an array of values.
  
  @param values Array of values.
  @return maximum value of the provided set.