Use commons-lang ArrayUtils.
Address comments.