NestedObjectDelegatePropertyAccessor implements
        PropertyAccessor { @SuppressWarnings("unchecked") public void setProperty(@SuppressWarnings("rawtypes") Map context, Object target, Object name, Object value) throws OgnlException { propertyAccessor.setProperty(context, nestedObjectExtractor .getNestedObject((T) target), name, value); } 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);  }
@SuppressWarnings("unchecked") @Test public void testSetProperty() throws OgnlException { NestedObjectExtractor<Integer> nestedObjectExtractor = createMock(NestedObjectExtractor.class); PropertyAccessor propertyAccessor = createMock(PropertyAccessor.class); Map<String, Object> context = createMock(Map.class); propertyAccessor.setProperty(context, "nested", "property", "value"); expect(nestedObjectExtractor.getNestedObject(1)).andReturn("nested"); replay(nestedObjectExtractor, propertyAccessor, context); PropertyAccessor accessor = new NestedObjectDelegatePropertyAccessor<Integer>( nestedObjectExtractor, propertyAccessor); accessor.setProperty(context, 1, "property", "value"); verify(nestedObjectExtractor, propertyAccessor, context); }