#vulnerable code 
                                @Test
    public void parsePayloadLooksForValueWithGivenKeyTopic(@Mocked final Mqtt mockMqtt) throws IOException
    {
        MqttMessaging testMqttMessaging = new MqttMessaging(serverUri, clientId, userName, password);

        final String insertTopic = "devices/" + clientId + "/messages/devicebound/abc";
        final byte[] insertMessage = {0x61, 0x62, 0x63};
        ConcurrentSkipListMap<String, byte[]> testMap = new ConcurrentSkipListMap<String, byte[]>();
        testMap.put(insertTopic, insertMessage);
        Deencapsulation.setField(mockMqtt, "allReceivedMessages", testMap);

        byte[] retrieveMessage = testMqttMessaging.parsePayload(insertTopic);

        assertEquals(insertMessage.length, retrieveMessage.length);
        for (int i = 0 ; i < retrieveMessage.length; i++)
        {
            assertEquals(retrieveMessage[i], insertMessage[i]);
        }

    } 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void parsePayloadLooksForValueWithGivenKeyTopic(@Mocked final Mqtt mockMqtt) throws IOException
    {
        MqttMessaging testMqttMessaging = new MqttMessaging(serverUri, clientId, userName, password);

        final String insertTopic = "devices/" + clientId + "/messages/devicebound/abc";
        final byte[] insertMessage = {0x61, 0x62, 0x63};
        ConcurrentSkipListMap<String, byte[]> testMap = new ConcurrentSkipListMap<String, byte[]>();
        testMap.put(insertTopic, insertMessage);
        Deencapsulation.setField(mockMqtt, "allReceivedMessages", testMap);

        byte[] retrieveMessage = Deencapsulation.invoke(testMqttMessaging, "parsePayload", insertTopic);

        assertEquals(insertMessage.length, retrieveMessage.length);
        for (int i = 0 ; i < retrieveMessage.length; i++)
        {
            assertEquals(retrieveMessage[i], insertMessage[i]);
        }

    }