### Question:
LazyModel implements IModel<T>, IObjectClassAwareModel<T>,
		IObjectTypeAwareModel<T>, IPropertyReflectionAwareModel<T> { public void setObject(T result) { checkBound(); Object target = this.target; MethodIterator methodIterator = new MethodIterator(); if (!methodIterator.hasNext()) { if (target instanceof IModel) { ((IModel<T>) target).setObject(result); return; } else { throw new UnsupportedOperationException(); } } if (target instanceof IModel) { target = ((IModel<T>) target).getObject(); } if (target == null) { throw new WicketRuntimeException("no target"); } methodIterator.next(target.getClass()); while (target != null && methodIterator.hasNext()) { target = methodIterator.get(target); methodIterator.next(target.getClass()); } methodIterator.set(target, result); } LazyModel(Object target, Object stack); IModel<T> loadableDetachable(); @Override Class<T> getObjectClass(); Type getObjectType(); @Override Field getPropertyField(); @Override Method getPropertyGetter(); @Override Method getPropertySetter(); @Override void detach(); T getObject(); void setObject(T result); Object getTarget(); LazyModel<T> bind(Object target); @Override String toString(); String getPath(); static T from(T target); static T from(Class<T> targetType); static T from(IModel<T> target, Class<T> type); static T from(IModel<T> target); static LazyModel<R> model(R result); static String path(R result); static IMethodResolver methodResolver; }### Answer:
@Test public void setObject() { A a = new A(); LazyModel<B> model = model(from(a).getB()); assertEquals(B.class, model.getObjectClass()); assertEquals("b", model.getPath()); B b = new B(); model.setObject(b); assertEquals(b, a.b); }