}
public void testClear() {
credentials.clear();
NameCallback nameCallback = new NameCallback("user");
PasswordCallback passwordCallback = new PasswordCallback("password", false);
Callback[] callbacks = new Callback[]{nameCallback, passwordCallback};
try {
credentials.handle(callbacks);
} catch (UnsupportedCallbackException e) {
fail();
}
assertEquals(USERNAME, nameCallback.getName());
assertTrue(Arrays.equals(new char[]{0,0,0,0,0,0,0,0}, passwordCallback.getPassword()));
}