### Question:
AuthorizationUtils { public static String[] getAuthorizationParts(MessageContext mc) { return getAuthorizationParts(mc, Collections.singleton("Basic")); } private  AuthorizationUtils(); static String[] getBasicAuthUserInfo(MessageContext mc); static String[] getBasicAuthParts(String basicAuthData); static String[] getAuthorizationParts(MessageContext mc); static String[] getAuthorizationParts(MessageContext mc,
                                                 Set<String> challenges); static String[] getAuthorizationParts(MessageContext mc,
                                                 Set<String> challenges,
                                                 String realm); static void throwAuthorizationFailure(Set<String> challenges); static void throwAuthorizationFailure(Set<String> challenges, String realm); static void throwAuthorizationFailure(Set<String> challenges, String realm, Throwable cause);  }### Answer:
@Test public void getAuthorizationParts() { String type = "type"; String credentials = "credentials"; Message m = new MessageImpl(); m.put(Message.PROTOCOL_HEADERS, Collections.singletonMap(HttpHeaders.AUTHORIZATION, Collections.singletonList(type + ' ' + credentials))); MessageContext mc = new MessageContextImpl(m); String[] expected = new String[] {type, credentials}; assertArrayEquals(expected, AuthorizationUtils.getAuthorizationParts(mc, null)); assertArrayEquals(expected, AuthorizationUtils.getAuthorizationParts(mc, Collections.emptySet())); assertArrayEquals(expected, AuthorizationUtils.getAuthorizationParts(mc, Collections.singleton(type))); assertArrayEquals(expected, AuthorizationUtils.getAuthorizationParts(mc, Collections.singleton("*"))); assertArrayEquals(expected, AuthorizationUtils.getAuthorizationParts(mc, new HashSet<>(Arrays.asList("another", type)))); }