public static void setValue(Object target, String attributeName, Object value) {
//        if(value != null) {
//            System.out.println("<- " + value.getClass() + " = " + value);
//        }
//        else {
//            System.out.println("<- ??? = null");
//        }
        for (Method method : target.getClass().getMethods()) {
            if (!method.getName().equals("set" + attributeName)) {
                continue;
            }
            if (method.getParameterCount() != 1) {
                continue;
            }
            Parameter param = method.getParameters()[0];
            //System.out.println("-> " + param.getType());
            try {
                method.invoke(target, param.getType().cast(value));
                return;
            } catch (Exception e1) {
                try {
                    method.invoke(target, value);
                    return;
                } catch (Exception e2) {
                    //e2.printStackTrace();
                }
                //System.out.println("Failed to set value of type:");
                //System.out.println("Source type: " + value.getClass().getName());
                //System.out.println("Target type: " + param.getType().getName());

            }
        }
        throw new IllegalStateException("Setter set" + attributeName + " not found!");
    }