Given that arr.length returns 500 shouldn\'t Arrays.copyOfRange(arr, 0, 4).length return 4?
arr.length
Arrays.copyOfRange(arr, 0, 4).length