### Question:
SecurityContextImpl implements SecurityContext { public String getAuthenticationScheme() { if (m.get(AuthorizationPolicy.class) != null) { return SecurityContext.BASIC_AUTH; } @SuppressWarnings("unchecked") Map<String, List<String>> headers = (Map<String, List<String>>)m.get(Message.PROTOCOL_HEADERS); if (headers != null) { List<String> values = headers.get(HttpHeaders.AUTHORIZATION); if (values != null && values.size() == 1) { String value = values.get(0); if (value != null) { int index = value.trim().indexOf(' '); if (index != -1) { return value.substring(0, index); } } } } return null; } SecurityContextImpl(Message m); String getAuthenticationScheme(); Principal getUserPrincipal(); boolean isSecure(); boolean isUserInRole(String role);  }### Answer:
@Test public void testAuthenticationScheme() { Message m = new MessageImpl(); Map<String, List<String>> requestHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); List<String> values = new ArrayList<>(); values.add("Digest realm=\"custom\""); requestHeaders.put("Authorization", values); m.put(Message.PROTOCOL_HEADERS, requestHeaders); String scheme = new SecurityContextImpl(m).getAuthenticationScheme(); assertEquals("Digest", scheme); }