Refactor Arrays based on the new java.util.Arrays.copyOf methods which
do most of the work for you.