code: public static <T> T getElementAt(T[] array, int index, T defaultValue) {
      return nullSafeLength(array) > index ? array[index] : defaultValue;
    }
docs: Returns the element at the given index in the {@code array}.
  
  @param <T> {@link Class} type of elements in the array.
  @param array array from which to extract the given element at index.
  @param index integer indicating the index of the element in the array to return.
  @param defaultValue default value to return if the array is {@literal null}, empty
  or does not have an element at the given index.
  @return the element at the given index in the array, or returns the default value
  if the array is {@literal null}, empty or does not contain an element at the given index.
  @see #getElementAt(Object[], int, Object)