protected float[] ensureCapacity(float[] arr, int size) {
        if (arr == null) {
            return new float[size];
        } else if (arr.length >= size) {
            return arr;
        } else {
            float[] tmp = new float[size];
            System.arraycopy(arr, 0, tmp, 0, arr.length);
            return tmp;
            //return Arrays.copyOf(arr, size);
        }
    }
Ensure the capacity for the given array and the given size
@param arr the array
@param size the size
@return an array
jme3-core/src/main/java/com/jme3/animation/CompactArray.java