for (int i = 0; i < callbacks.length; i++) {
Callback callback = callbacks[i];
if (callback instanceof NameCallback) {
((NameCallback)callback).setName("User");
} else if (callback instanceof PasswordCallback) {
((PasswordCallback)callback).setPassword(new char[] { 'P" });
} else {
throw new UnsupportedCallbackException(callback);
}
}