public static NettySourceConfig load(Map<String, Object> map) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(mapper.writeValueAsString(map), NettySourceConfig.class);
    }
@Test
    public void testNettyTcpConfigLoadWithMap() throws IOException {
        Map<String, Object> map = new HashMap<>();
        map.put("type", TCP);
        map.put("host", LOCALHOST);
        map.put("port", 10999);
        map.put("numberOfThreads", 1);

        NettySourceConfig nettySourceConfig = NettySourceConfig.load(map);
        assertNotNull(nettySourceConfig);
        assertEquals(TCP, nettySourceConfig.getType());
        assertEquals(LOCALHOST, nettySourceConfig.getHost());
        assertEquals(10999, nettySourceConfig.getPort());
        assertEquals(1, nettySourceConfig.getNumberOfThreads());
    }