title: Paho MQTT throws Exception
body: <p>I have downloaded an example in Java in order to demonstrate Paho MQTT.</p>
  
  <pre><code> public class Thermometer {
  
      public static final String BROKER_URL = "tcp://test.mosquitto.org:1883";
  
      public static final String TOPIC = "xyz.abc";
  
      private MqttClient client;
  
  
      public Thermometer() {
          try {
              MemoryPersistence per = new MemoryPersistence();
              String clientId = UUID.randomUUID().toString();
              client = new MqttClient(BROKER_URL, clientId, per);
          } catch (MqttException e) {
              e.printStackTrace();
              System.exit(1);
          }
      }
  </code></pre>
  
  <p>Problem occurs when I run it, it locates at <code>client = new MqttClient(BROKER_URL, clientId, per);</code> with </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException
        at org.eclipse.paho.client.mqttv3.MqttClient.(MqttClient.java:170)
        at mqtt_pub.Thermometer.(Thermometer.java:26)
        at mqtt_pub.Thermometer.main(Thermometer.java:65)</p>
  </blockquote>
  
  <p>I have found that @throws IllegalArgumentException if value of QoS is not 0, 1 or 2 but in class MemoryPersistence they did not mentioned. Please help, thank you in advance.</p>