code: public static <T> T getLast(T[] array, T defaultValue) {
      return getElementAt(array, Math.max(0, nullSafeLength(array) - 1), defaultValue);
    }
docs: Returns the last element (at index 0) in the {@code array}.
  
  @param <T> {@link Class} type of elements in the array.
  @param array array from which to extract the last element.
  @param defaultValue default value to return if the given array is {@literal null} or empty.
  @return the last element in the array or return the {@code defaultValue} if the {@code array}
  is {@literal null} or empty.
  @see #getElementAt(Object[], int, Object)