public static long[] subarray(long[] array, int startIndexInclusive, int endIndexExclusive) {
        if (array == null) {
            return null;
        }
        if (startIndexInclusive < 0) {
            startIndexInclusive = 0;
        }
        if (endIndexExclusive > array.length) {
            endIndexExclusive = array.length;
        }
        int newSize = endIndexExclusive - startIndexInclusive;
        if (newSize <= 0) {
            return EMPTY_LONG_ARRAY;
        }

        long[] subarray = new long[newSize];
        System.arraycopy(array, startIndexInclusive, subarray, 0, newSize);
        return subarray;
    }
<p>Produces a new {@code long} array containing the elements
between the start and end indices.</p>

<p>The start index is inclusive, the end index exclusive.
Null array input produces null output.</p>

@param array  the array
@param startIndexInclusive  the starting index. Undervalue (&lt;0)
     is promoted to 0, overvalue (&gt;array.length) results
     in an empty array.
@param endIndexExclusive  elements up to endIndex-1 are present in the
     returned subarray. Undervalue (&lt; startIndex) produces
     empty array, overvalue (&gt;array.length) is demoted to
     array length.
@return a new array containing the elements between
     the start and end indices.
@since 2.1
android/android_framework/base/src/main/java/lang3/ArrayUtils.java