attributes.put("manyToOneAttr", new ManyToOneAttribute(value));
service.setAttributes(bean, layerBeans.getLayerInfo().getFeatureInfo(), new DummyMapper(), attributes);
Assert.assertNotNull(bean.getManyToOneAttr());
Assert.assertEquals("mto",bean.getManyToOneAttr().getStringAttr());
// test replacing
ManyToOneAttributeBean original = new ManyToOneAttributeBean();
original.setId(5L);
original.setStringAttr("original");
bean.setManyToOneAttr(original);
service.setAttributes(bean, layerBeans.getLayerInfo().getFeatureInfo(), new DummyMapper(), attributes);
Assert.assertNotNull(bean.getManyToOneAttr());
// should be replaced
Assert.assertNotSame(original,bean.getManyToOneAttr());