boolean (boolean isUserName) { if (authentication != null) { sendData(isUserName ? authentication.getUserName() : authentication.getPassword()); } else { cancelAuthentication(); } return authentication != null; }