I would also expect the following test to pass (with spaces by the delimiter):
<code>
when(request.getHeader("Groups")).thenReturn("a , b");
</code>

You should be able to add "name.trim()" at HttpHeaderPrincipalProvider:144.