### Question:
ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy<T> { public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; }  void captureHeader(CsvReader reader); String[] getColumnMapping(); void setColumnMapping(String... columnMapping);  }### Answer:
@Test public void testParse() { String s = "" + "kyle,123456,emp123,1\n" + "jimmy,abcnum,cust09878,2"; strat.setColumnMapping("name", "orderNumber", "id", "num"); CsvToBean<MockBean> csv = new CsvToBean<MockBean>(); List<MockBean> list = csv.parse(strat, new StringReader(s)); assertNotNull(list); assertTrue(list.size() == 2); MockBean bean = list.get(0); assertEquals("kyle", bean.getName()); assertEquals("123456", bean.getOrderNumber()); assertEquals("emp123", bean.getId()); assertEquals(1, bean.getNum()); }
@Test public void testParseWithTrailingSpaces() { String s = "" + "kyle ,123456 ,emp123 , 1 \n" + "jimmy,abcnum,cust09878,2 "; String[] columns = new String[]{"name", "orderNumber", "id", "num"}; strat.setColumnMapping(columns); CsvToBean<MockBean> csv = new CsvToBean<MockBean>(); List<MockBean> list = csv.parse(strat, new StringReader(s)); assertNotNull(list); assertTrue(list.size() == 2); MockBean bean = list.get(0); assertEquals("kyle ", bean.getName()); assertEquals("123456 ", bean.getOrderNumber()); assertEquals("emp123 ", bean.getId()); assertEquals(1, bean.getNum()); }