@SuppressWarnings("unchecked")
@Test
public void testGetSourceSetter() {

    PropertyAccessorDelegateFactory<Integer> factory = createMock(PropertyAccessorDelegateFactory.class);
    PropertyAccessor mockAccessor = createMock(PropertyAccessor.class);
    OgnlContext context = createMock(OgnlContext.class);
    expect(factory.getPropertyAccessor("property", 1)).andReturn(mockAccessor);
    expect(mockAccessor.getSourceSetter(context, 1, "property")).andReturn("method");
    replay(factory, mockAccessor, context);
    PropertyAccessor accessor = new DelegatePropertyAccessor<Integer>(factory);
    assertEquals("method", accessor.getSourceSetter(context, 1, "property"));
    verify(factory, mockAccessor, context);
}