}
@Test
public void question_dot_operator_for_object_type()
{
PropertyConduit normal = _source.create(CompositeBean.class, "simple.firstName");
PropertyConduit smart = _source.create(CompositeBean.class, "simple?.firstName");
CompositeBean bean = new CompositeBean();
bean.setSimple(null);
try
{
normal.get(bean);
unreachable();
}
catch (NullPointerException ex)
{
// Expected.
}
assertNull(smart.get(bean));
try
{
normal.set(bean, "Howard");
unreachable();
}
catch (NullPointerException ex)
{
// Expected.
}
// This will be a no-op due to the null property in the expression
smart.set(bean, "Howard");
}