and corresponding tests.
Added replaceAll and sort methods from the upstream except for the
CopyOnWriteArrayList.
Added forEach method along with the above two methods in
CopyOnWriteArrayList.
Bug: 27693350
Bug: 27540008
(cherry-picked from commit 6206c9f2e70d7b63d8a306a46534c21e4f8fe6f7)
Change-Id: I9efbd66b65c06b50fc20f63d477c25a05a8fae02