1d09efeeb2
Motivation: We did not correctly copy elements in some cases when add(index, element) was used. Modifications: - Correctly detect when copy is neede and when not. - Add test case. Result: Fixes https://github.com/netty/netty/issues/7938.