### Question:
SubFacet implements Facet { @Override public void setValue(Object pojo, Object value) { Object parentValue = parentValue(pojo); if (parentValue != null) { child.setValue(parentValue, value); } } SubFacet(Facet parent, Facet child, boolean autoCreateParent); @Override Facet flatten(); @Override A getAnnotation(Class<A> annotationType); @Override String getName(); @Override GenericType getType(); @Override Object getValue(Object pojo); @Override boolean hasAnnotation(Class<A> annotationType); @Override void setValue(Object pojo, Object value); @Override List<Facet> subFacets(boolean autoCreateParent); static final String SEPARATOR; }### Answer:
@Test public void testLenientSetValue() { Parent parent = new Parent(); lenientFacet.setValue(parent, "test_value"); assertNotNull(parent.child); lenientFacet.setValue(parent, "test_value"); assertEquals("test_value", parent.child.property); }
@Test public void testStrictSetValue() { Parent parent = new Parent(); strictFacet.setValue(parent, "test_value"); assertNull(parent.child); }