### Question:
SimpleOneWayPropertyInfo { public String propertyType() { WrappedTypeMirror parameterType = setter.parameterType(); if(parameterType.isPrimitive()) { return ((WrappedPrimitiveType)parameterType).boxedClassName(); } else { return parameterType.className(); } } SimpleOneWayPropertyInfo(SetterElement setter); String propertySetter(); String propertyType(); String propertyName(); JDefinedClass getBindingClass(); JDefinedClass defineBindingClass(ClassDefinitionCallback callback); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void givenPrimitivePropertyType_thenReturnBoxedType() { final SetterElement setter = context.mock(SetterElement.class); final WrappedPrimitiveType primitiveType = context.mock(WrappedPrimitiveType.class); context.checking(new Expectations() {{ oneOf(setter).parameterType(); will(returnValue(primitiveType)); oneOf(primitiveType).isPrimitive(); will(returnValue(true)); oneOf(primitiveType).boxedClassName(); will(returnValue(Integer.class.getName())); }}); SimpleOneWayPropertyInfo info = new SimpleOneWayPropertyInfo(setter); assertThat(info.propertyType(), equalTo(Integer.class.getName())); }
@Test public void givenObjectPropertyType_thenReturnSameType() { final SetterElement setter = context.mock(SetterElement.class); final WrappedDeclaredType declaredType = context.mock(WrappedDeclaredType.class); context.checking(new Expectations() {{ oneOf(setter).parameterType(); will(returnValue(declaredType)); oneOf(declaredType).isPrimitive(); will(returnValue(false)); oneOf(declaredType).className(); will(returnValue(Object.class.getName())); }}); SimpleOneWayPropertyInfo info = new SimpleOneWayPropertyInfo(setter); assertThat(info.propertyType(), equalTo(Object.class.getName())); }