### Question:
NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public String getSourceAccessor(OgnlContext context, Object target, Object index) { return propertyAccessor.getSourceAccessor(context, nestedObjectExtractor.getNestedObject((T) target), index); } NestedObjectDelegatePropertyAccessor(
            NestedObjectExtractor<T> nestedObjectExtractor,
            PropertyAccessor propertyAccessor); @SuppressWarnings("unchecked") Object getProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name); @SuppressWarnings("unchecked") void setProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name,
            Object value); @SuppressWarnings("unchecked") String getSourceAccessor(OgnlContext context, Object target,
            Object index); @SuppressWarnings("unchecked") String getSourceSetter(OgnlContext context, Object target,
            Object index);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testGetSourceAccessor() { NestedObjectExtractor<Integer> nestedObjectExtractor = createMock(NestedObjectExtractor.class); PropertyAccessor propertyAccessor = createMock(PropertyAccessor.class); OgnlContext context = createMock(OgnlContext.class); expect(propertyAccessor.getSourceAccessor(context, "nested", "property")).andReturn("method"); expect(nestedObjectExtractor.getNestedObject(1)).andReturn("nested"); replay(nestedObjectExtractor, propertyAccessor, context); PropertyAccessor accessor = new NestedObjectDelegatePropertyAccessor<Integer>( nestedObjectExtractor, propertyAccessor); assertEquals("method", accessor.getSourceAccessor(context, 1, "property")); verify(nestedObjectExtractor, propertyAccessor, context); }