Replace usage of CopyOnWriteArraySet.

Use a List<Class<?>> as the cache key instead, but
dedup and check for nulls in the list using a HashSet
instead. This will improve performance for large
lists of interfaces.

bug: 10316383

Change-Id: Id0c36a731e6e3cb39bf36c083180c0c4da5c2dd4
(cherry picked from commit 6074af533f57a93e1b8e1ab63dce6a264a4d5dae)
3 files changed