public void shouldNotInstantiateIfLastTerm() throws OgnlException, NoSuchMethodException {
final TypeConverter typeConverter = mock(TypeConverter.class);
final House house = new House();
final Mouse tom = new Mouse();
Method method = House.class.getDeclaredMethod("setMouse", Mouse.class);
when(typeConverter.convertValue(context, house, method, "mouse", "22", Mouse.class)).thenReturn(tom);
Ognl.setTypeConverter(context, typeConverter);
Ognl.setValue("mouse", context, house, "22");
assertThat(house.getMouse(), is(equalTo(tom)));
}