public static void populateFromMap(Object obj, Map<String, Object> properties,
                                       Map<String, Method> setters) throws IllegalAccessException,
            InvocationTargetException {
        if (obj == null || setters == null || setters.isEmpty()) {
            return;
        }
        for (Map.Entry<String, Method> stringMethodEntry : setters.entrySet()) {
            Method setter = stringMethodEntry.getValue();
            String prop = propertyFor(setter);
            if (properties.containsKey(prop)) {
                Object[] args = { properties.get(prop) };
                setter.invoke(obj, args);
            }
        }
    }