code: @NullSafe
    @SuppressWarnings("unchecked")
    public static <T> T[] nullSafeArray(T[] array, Class<?> componentType) {
      return array != null ? array : (T[]) Array.newInstance(defaultIfNull(componentType, Object.class), 0);
    }
docs: Null-safe method returning the array if not null otherwise returns an empty array.
  
  @param <T> Class type of the elements in the array.
  @param array array to evaluate.
  @param componentType {@link Class} type of the elements in the array.  Defaults to {@link Object} if null.
  @return the array if not null otherwise an empty array.
  @see java.lang.reflect.Array#newInstance(Class, int)
  @see #nullSafeArray(Object[])