Remove manual array copy

Remove manual array coping by using Arrays.copyOf(values, values.length)