### Question:
Instance { public static <T extends Model> T transfer(Class<T> target, String filedName, Object value) { if (filedName == null || value == null){ throw new RuntimeException("argument is null!") ; } T obj = null; try { obj = target.newInstance(); filedName = methodName(filedName) ; Method method = target.getMethod("set" + filedName ,value.getClass()); method.invoke(obj, value); return obj; } catch (Exception e) { log.error("exception",e); } return obj; }  static T transfer(Class<T> target, String filedName, Object value); static T transfer(Class<T> target, Map<String,Object> params); static Object getFiledValue(Object obj, Field field);  }### Answer:
@Test public void transfer() { User user = Instance.transfer(User.class, "id", 123); log.info("user={}", user.toString()); }
@Test public void transfers(){ Map<String,Object> fields = new HashMap<>() ; fields.put("id" ,100) ; fields.put("name", "张三") ; User user = Instance.transfer(User.class, fields); log.info("user={}", user.toString()); }