+1 for patch 02, pending pre-commit.
- policyProviderProtocols = new ArrayList<>(services.length);
+ policyProviderProtocols = new HashSet<>(services.length);
Just a very minor nit: Passing a length to a collection constructor is usually meant to avoid a memory realloc when the expected length is known. With the switch from ArrayList to HashSet, that doesn't really work anymore though, because the argument is now interpreted as the internal hash table's capacity, with a realloc occurring after exceeding (capacity * load factor), which defaults to 0.75. Things like Guava's Maps#newHashMapWithExpectedSize internally do some math on the argument to scale it up and try to stay ahead of the load factor to prevent a realloc.
It doesn't really matter much here, where it's just test code and the data set is tiny, so I'm still +1 for the patch. It's just a common pitfall of the HashMap/HashSet API.
Thanks for the patch!