#vulnerable code 
                                @Test
    public void avoidMultipleNotificationsAfterMultipleReconnection_cleanSessionFalseQoS1() throws Exception {
        LOG.info("*** avoidMultipleNotificationsAfterMultipleReconnection_cleanSessionFalseQoS1, issue #16 ***");
        MqttConnectOptions options = new MqttConnectOptions();
        options.setCleanSession(false);
        m_client.connect(options);
        m_client.subscribe("/topic", 1);
        m_client.disconnect();
        
        publishFromAnotherClient("/topic", "Hello MQTT 1".getBytes(), 1);
        m_callback.reinit();
        m_client.connect(options);
        
        assertNotNull(m_callback);
        assertNotNull(m_callback.getMessage());
        assertEquals("Hello MQTT 1", m_callback.getMessage().toString());
        m_client.disconnect();
        
        //publish other message
        publishFromAnotherClient("/topic", "Hello MQTT 2".getBytes(), 1);
        
        //reconnect the second time
        m_callback.reinit();
        m_client.connect(options);
        assertNotNull(m_callback);
        assertNotNull(m_callback.getMessage());
        assertEquals("Hello MQTT 2", m_callback.getMessage().toString());
    } 
                            #location 16 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void avoidMultipleNotificationsAfterMultipleReconnection_cleanSessionFalseQoS1() throws Exception {
        LOG.info("*** avoidMultipleNotificationsAfterMultipleReconnection_cleanSessionFalseQoS1, issue #16 ***");
        MqttConnectOptions options = new MqttConnectOptions();
        options.setCleanSession(false);
        m_client.connect(options);
        m_client.subscribe("/topic", 1);
        m_client.disconnect();
        
        publishFromAnotherClient("/topic", "Hello MQTT 1".getBytes(), 1);
        m_callback.reinit();
        m_client.connect(options);
        
        assertNotNull(m_callback);
        MqttMessage message = m_callback.getMessage(true);
        assertNotNull(message);
        assertEquals("Hello MQTT 1", message.toString());
        m_client.disconnect();
        
        //publish other message
        publishFromAnotherClient("/topic", "Hello MQTT 2".getBytes(), 1);
        
        //reconnect the second time
        m_callback.reinit();
        m_client.connect(options);
        assertNotNull(m_callback);
        message = m_callback.getMessage(true);
        assertNotNull(message);
        assertEquals("Hello MQTT 2", message.toString());
    }