code: public static UsernameAttribute createUsernameAttribute(String username) {
  		UsernameAttribute attribute = new UsernameAttribute();
  
  		try {
  			attribute.setUsername(username.getBytes("UTF-8"));
  		} catch (UnsupportedEncodingException ueex) {
  			throw new UndeclaredThrowableException(ueex);
  		}
  		return attribute;
  	}
docs: Creates a new <tt>UsernameAttribute</tt> instance.
  
  @param username
  the String value of the username
  @return a new <tt>UsernameAttribute</tt> instance