public static <T> T mapToBean(Map<String, Object> map, Class<T> cls) {
        if (map == null || cls == null) return (T) null;
        T ret = null;
        try{
            ret = cls.newInstance();
            Map<String, Method> nameWriterMapping = resolveNameWriterMapping(cls);
            for (String key : map.keySet()) {
                Method writer = nameWriterMapping.get(key);
                if (writer == null) {
                    continue;
                }
                writer.invoke(ret, map.get(key));
            }
        }catch(Exception e){
            throw new RuntimeException("Method mapToBean has cause a exception", e);
        }
        return ret;
    }