String challenge1 = "Digest realm=\"realm1\", nonce=\"abcde\"";
String challenge2 = "Digest realm=\"realm2\", nonce=\"123546\"";
UsernamePasswordCredentials cred = new UsernamePasswordCredentials("username","password");
UsernamePasswordCredentials cred2 = new UsernamePasswordCredentials("uname2","password2");
FakeHttpMethod method = new FakeHttpMethod("/");
AuthScheme authscheme1 = new DigestScheme();
authscheme1.processChallenge(challenge1);
String response1 = authscheme1.authenticate(cred, method);
Map table = AuthChallengeParser.extractParams(response1);
assertEquals("username", table.get("username"));