public void proxySet() {
List<ModelConverter> converters = new ArrayList<ModelConverter>();
ModelConverter converterMock = createMock(ModelConverter.class);
expect(converterMock.getSourceType()).andReturn(Person.class).anyTimes();
converters.add(converterMock);
Person personImpl1 = new PersonImpl();
Person personImpl2 = new PersonImpl();
expect(converterMock.convert(personImpl1)).andReturn(personImpl2);
replay(converterMock);
List<PersonImpl> underlying = createMock(List.class);
expect(underlying.set(0, (PersonImpl)personImpl2)).andReturn((PersonImpl) personImpl2);
replay(underlying);
new JpaConverter(converters);
List<Person> personProxy = ConvertingListProxyFactory.createProxyList(Person.class, underlying);
Person good = personProxy.set(0, personImpl1);
assertThat(good, is(sameInstance(personImpl2)));
verify(converterMock);
verify(underlying);
}