code: @SuppressWarnings("unchecked")
    public static <T> T[] nullToEmpty(final T[] array) {
      return array == null ? (T[])EMPTY_ARRAY : array;
    }
docs: Return an empty array if input is null; works as identity function otherwise.
  This function is useful in `for` statements if the iterable can be null.
  @param array Input array. Can be null.
  @param <T> Type of the elements of the array.
  @return A reference to the input array if it is not null, an empty array otherwise.