public static long[] copyOfRange(long[] original, int start, int end) {if (start > end) {throw new IllegalArgumentException();}int originalLength = original.length;if (start < 0 || start > originalLength) {throw new ArrayIndexOutOfBoundsException();}int resultLength = end - start;int copyLength = Math.min(resultLength, originalLength - start);long[] result = new long[resultLength];System.arraycopy(original, start, result, 0, copyLength);return result;}