code: @Nullable
    public static <T> T getLast(Iterable<? extends T> iterable, @Nullable T defaultValue) {
      if (iterable instanceof Collection) {
        Collection<? extends T> c = Collections2.cast(iterable);
        if (c.isEmpty()) {
          return defaultValue;
        } else if (iterable instanceof List) {
          return getLastInNonemptyList(Lists.cast(iterable));
        }
      }
  
      return Iterators.getLast(iterable.iterator(), defaultValue);
    }
docs: Returns the last element of {@code iterable} or {@code defaultValue} if
  the iterable is empty. If {@code iterable} is a {@link List} with
  {@link RandomAccess} support, then this operation is guaranteed to be {@code O(1)}.
  
  @param defaultValue the value to return if {@code iterable} is empty
  @return the last element of {@code iterable} or the default value
  @since 3.0