### Question:
PropertyField { public void setValue(ENTITY entity, Object value) { AssertionUtil.assertNotNull(entity); if (fields.size() > 1) { throw new UnsupportedOperationException(); } setFieldValue(fields.getFirst(), entity, value); } PropertyField(String path, Class<ENTITY> entityClass); Object getValue(ENTITY entity); void setValue(ENTITY entity, Object value); boolean isPrimitive();  }### Answer:
@Test public void testSetValue_simplePath() { Person person = new Person(); PropertyField<Person> path = new PropertyField<>("name", Person.class); path.setValue(person, "foo"); assertEquals("foo", person.name); }
@Test public void testSetValue_parentPath() { Person person = new Person(); PropertyField<Person> path = new PropertyField<>("kind", Person.class); path.setValue(person, "foo"); assertEquals("foo", person.kind); }
@Test public void testSetValue_nestedPath() { Person person = new Person(); PropertyField<Person> path = new PropertyField<>("address.city", Person.class); try { path.setValue(person, "Kyoto"); fail(); } catch (UnsupportedOperationException expected) { } }
@Test public void testSetValue_nestedParentPath() { Person person = new Person(); PropertyField<Person> path = new PropertyField<>("address.kind", Person.class); try { path.setValue(person, "island"); fail(); } catch (UnsupportedOperationException expected) { } }