public static <T> void update(Map<String, String> properties, T obj) throws IllegalArgumentException {
        Field[] fields = obj.getClass().getDeclaredFields();
        Arrays.stream(fields).forEach(f -> {
            if (properties.containsKey(f.getName())) {
                try {
                    f.setAccessible(true);
                    String v = properties.get(f.getName());
                    if (!StringUtils.isBlank(v)) {
                        f.set(obj, value(trim(v), f));
                    } else {
                        setEmptyValue(v, f, obj);
                    }
                } catch (Exception e) {
                    throw new IllegalArgumentException(format("failed to initialize %s field while setting value %s",
                            f.getName(), properties.get(f.getName())), e);
                }
            }
        });
    }
@Test
    public void testMap() {
        Map<String, String> properties = new HashMap<>();
        properties.put("name", "config");
        properties.put("stringStringMap", "key1=value1,key2=value2");
        properties.put("stringIntMap", "key1=1,key2=2");
        properties.put("longStringMap", "1=value1,2=value2");

        MyConfig config = new MyConfig();
        FieldParser.update(properties, config);
        assertEquals(config.name, "config");
        assertEquals(config.stringStringMap.get("key1"), "value1");
        assertEquals(config.stringStringMap.get("key2"), "value2");

        assertEquals((int) config.stringIntMap.get("key1"), 1);
        assertEquals((int) config.stringIntMap.get("key2"), 2);

        assertEquals(config.longStringMap.get(1L), "value1");
        assertEquals(config.longStringMap.get(2L), "value2");

    }