code: public void setAll(Map<String, String> preferences)
  	{
  		// check it before sending it to the server in order to be able to raise a precise exception
  		for(Map.Entry<String,String> preference : preferences.entrySet())
  		{
  			checkPreferenceKeyLength(preference.getKey());
  			checkPreferenceValueLength(preference.getValue());
  		}
  
  		final Map<String, String> prefs = preferences;
  		osm.makeAuthenticatedRequest(
  				USERPREFS, "PUT", new XmlWriter()
  				{
  					@Override
  					protected void write() throws IOException
  					{
  						begin("osm");
  						begin("preferences");
  
  						for (Map.Entry<String, String> preference : prefs.entrySet())
  						{
  							begin("preference");
  							attribute("k", preference.getKey());
  							attribute("v", preference.getValue());
  							end();
  						}
  
  						end();
  						end();
  					}
  				});
  	}
docs: Sets all the given preference keys to the given preference values.
  
  @param preferences preferences to set. Each key and each value must be less than 256
  characters.
  
  @throws OsmAuthorizationException if this application is not authorized to change the
  user's preferences. (Permission.CHANGE_PREFERENCES)