#vulnerable code 
                                @Test
    public void getChannelNameFromMessageTest() throws IOException, InvocationTargetException, IllegalAccessException {


        Method method = MethodUtils.getMatchingMethod(HitbtcStreamingService.class, "getChannelNameFromMessage", JsonNode.class);
        method.setAccessible(true);

        String json = "{\"method\":\"aaa\"}";
        Assert.assertEquals("aaa", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"updateOrderbook\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("orderbook-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"snapshotOrderbook\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("orderbook-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"test\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("test-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"noMethod\": \"updateOrderbook\" } }";
        Throwable exception = null;
        try {
            method.invoke(streamingService, objectMapper.readTree(json));
        } catch (InvocationTargetException e) {
            exception = e.getTargetException();
        }
        Assert.assertNotNull("Expected IOException because no method", exception);
        Assert.assertEquals(IOException.class, exception.getClass());

    } 
                            #location 28 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void getChannelNameFromMessageTest() throws IOException, InvocationTargetException, IllegalAccessException {


        Method method = MethodUtils.getMatchingMethod(HitbtcStreamingService.class, "getChannelNameFromMessage", JsonNode.class);
        method.setAccessible(true);

        String json = "{\"method\":\"aaa\"}";
        Assert.assertEquals("aaa", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"updateOrderbook\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("orderbook-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"snapshotOrderbook\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("orderbook-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"method\": \"test\", \"params\": { \"symbol\": \"ETHBTC\" } }";
        Assert.assertEquals("test-ETHBTC", method.invoke(streamingService, objectMapper.readTree(json)));

        json = "{ \"noMethod\": \"updateOrderbook\" } }";

        thrown.expect(InvocationTargetException.class);
        method.invoke(streamingService, objectMapper.readTree(json));
    }