@SuppressWarnings("unchecked")
	public static final <T> T[] removeFirst(T[] array, T item, boolean preferNull) {
		if (array == null || array.length == 0) return array;
		final int index = indexOf(array, item);
		if (index < 0) return array;
		if (preferNull && array.length == 1) return null;
		return remove((Class<T>)array.getClass().getComponentType(), array, index);
	}