Yields the last element.

@param <E> the array element type
@param array the array that will be consumed @throw
IllegalArgumentException if no element is found
@return the last element
772334
public static <E> E last(E[] array) {
        return new LastElement<E>().apply(new ArrayIterator<>(array));
    }
436128
public void endArray() throws IOException {
    int p = peeked;
    if (p == PEEKED_NONE) {
      p = doPeek();
    }
    if (p == PEEKED_END_ARRAY) {
      stackSize--;
      pathIndices[stackSize - 1]++;
      peeked = PEEKED_NONE;
    } else {
      throw new IllegalStateException("Expected END_ARRAY but was " + peek() + locationString());
    }
  }
701120
public static <E> Optional<E> maybeOne(E[] array) {
        return new MaybeOneElement<E>().apply(new ArrayIterator<>(array));
    }
31267
public static <E> E one(E[] array) {
        return new OneElement<E>().apply(new ArrayIterator<>(array));
    }
909273
public static int max(IntArrayND array)
    {
        return array.stream().parallel().reduce(
            Integer.MIN_VALUE, Math::max);
    }
872903
public long[] toPrimitiveArray(long[] array) {
	for (int i = 0, j = 0; i < array.length; ++i) {
	    int index = -1;
	    if (j < indices.length && (index = indices[j]) == i) {
		array[i] = values[j];
		j++;
	    }
	    else
		array[i] = 0;
	}

	return array;
    }
1018838
public static function arrayAppendLast(
        array $array,
        string $last,
        string $others = null
    ) {
        $count = count($array);
        foreach ($array as $key => $value) {
            $array[$key] = $value . (--$count > 0 ? $others : $last);
        }
        return $array;
    }
157848
public static <E> E last(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call last with a null iterable");
        return new LastElement<E>().apply(iterable.iterator());
    }
607447
function last(array) {
      var length = array == null ? 0 : array.length;
      return length ? array[length - 1] : undefined$1;
    }
710725
public function last(array $elements, $amount = 1)
    {
        $elements = array_slice($elements, count($elements) - $amount);

        return count($elements) == 1 ? reset($elements) : $elements;
    }
774862
public HashCodeBuilder append(final byte[] array) {
        if (array == null) {
            iTotal = iTotal * iConstant;
        } else {
            for (final byte element : array) {
                append(element);
            }
        }
        return this;
    }
1195975
private String getLongestString(String[] array) {
        int maxLength = 0;
        String longestString = null;
        for (String s : array) {
            if (s.length() > maxLength) {
                maxLength = s.length();
                longestString = s;
            }
        }
        return longestString;
    }
695971
@SuppressWarnings("unchecked")
	public static <T> T get(Object array, int index) {
		if(null == array) {
			return null;
		}
		
		if (index < 0) {
			index += Array.getLength(array);
		}
		try {
			return (T) Array.get(array, index);
		} catch (ArrayIndexOutOfBoundsException e) {
			return null;
		}
	}
744591
@Nonnull
  @MayContainNull
  @Weight(Weight.Unit.NORMAL)
  public static <T> T[] append(@Nullable final T element, @MayContainNull @Nonnull final T[] array) {
    @SuppressWarnings("unchecked")
    final T[] result = (T[]) Array.newInstance(array.getClass().getComponentType(), array.length + 1);
    System.arraycopy(array, 0, result, 1, array.length);
    result[0] = element;
    return result;
  }
914408
public static <T, J extends Convertable<T>> ArrayList<T> convert(J[] array) {
        return convert(array == null ? null : Arrays.asList(array));
    }
270052
public static void notEmpty(final Object[] array, final String arrayName) {
        notNull(array, arrayName);

        if (array.length == 0) {
            throw new IllegalArgumentException("expecting " + maskNullArgument(arrayName) + " to contain 1 or more elements");
        }
    }
1205581
public static INDArray lastIndex(INDArray array, Condition condition) {
        if (!(condition instanceof BaseCondition))
            throw new UnsupportedOperationException("Only static Conditions are supported");

        LastIndex idx = new LastIndex(array, condition);
        Nd4j.getExecutioner().exec(idx);
        return Nd4j.scalar(DataType.LONG, idx.getFinalResult().longValue());
    }