### Question:
ReflectionUtils { public static void setField(Object obj, String name, Object value) { try { Field field = getField(obj.getClass(), name); if (field == null) { return; } field.setAccessible(true); field.set(obj, value); } catch (Exception e) { e.printStackTrace(); } }  static void setField(Object obj, String name, Object value); @Nullable static Object getDeclaredField(Object obj, String fieldName);  }### Answer:
@Test public void setField() throws Exception { Foo target = new Foo(); ReflectionUtils.setField(target, "bar", "a new value"); assertThat(target.bar).isEqualTo("a new value"); }