ServiceDateFieldMappingFactory implements FieldMappingFactory { public FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory, Class<?> entityType, String csvFieldName, String objFieldName, Class<?> objFieldType, boolean required) { return new FieldMappingImpl(entityType, csvFieldName, objFieldName, required); }  FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory,
      Class<?> entityType, String csvFieldName, String objFieldName,
      Class<?> objFieldType, boolean required);  }
@Test public void test() { ServiceDateFieldMappingFactory factory = new ServiceDateFieldMappingFactory(); DefaultEntitySchemaFactory schemaFactory = new DefaultEntitySchemaFactory(); String propName = "date"; FieldMapping mapping = factory.createFieldMapping(schemaFactory, Dummy.class, propName, propName, ServiceDate.class, true); CsvEntityContext context = new CsvEntityContextImpl(); Map<String, Object> csvValues = new HashMap<String, Object>(); csvValues.put(propName, "20100212"); Dummy obj = new Dummy(); BeanWrapper wrapped = BeanWrapperFactory.wrap(obj); mapping.translateFromCSVToObject(context, csvValues, wrapped); assertEquals(new ServiceDate(2010, 2, 12), obj.getDate()); csvValues.clear(); mapping.translateFromObjectToCSV(context, wrapped, csvValues); assertEquals("20100212", csvValues.get(propName)); }