### Question:
CommonFormat { public ReportLine toCommonFormat(List<String> sourceRow) throws ParseException { if (columnMeta.getColumnMapping() == null) { return toReportLine(sourceRow); } List<String> targetRow = new ArrayList<String>(); for (ColumnInfo columnInfo : columnMeta.getColumnMapping()) { targetRow.add((columnInfo.sourceIndex < 0 ? "" : (columnInfo.sourceIndex < sourceRow.size() ? sourceRow.get(columnInfo.sourceIndex) : null))); } return toReportLine(targetRow); } CommonFormat(ColumnMeta columnMeta);  CommonFormat(ColumnMeta columnMeta, char sourceDecimalSeparator, char sourceGroupingSeparator); ReportLine toCommonFormat(List<String> sourceRow); static String rowToString(List<String> row); static String rowToString(ReportLine row); double parseDouble(String columnName, String value); static String doubleToString(double value); ReportLine toReportLine(List<String> row); static void printRow(String[] row); static void printRow(List<String> row); static final char FIELD_SEPARATOR; static final char FIELD_DELIMITER; static final char ESCAPE_CHAR; static final char DECIMAL_SEPARATOR_DEFAULT; static final char DECIMAL_GROUPING_SEPARATOR_DEFAULT; }### Answer:
@Test public void toCommonFormat() throws InitializationException, ParseException { final CommonFormat format = getInstance(); final List<String> values = Lists.newArrayList("value1", "value2", "value3", "value4"); final ReportLine r = format.toCommonFormat(values); assertEquals("value2", r.getDlabId()); assertEquals("value1", r.getUser()); assertEquals(2, r.getTags().size()); assertEquals("value4", r.getTags().get("sCol4")); assertEquals("value3", r.getTags().get("sCol3")); assertEquals(123456.789, format.parseDouble("column1", "123 456.789")); assertEquals("12345.678", CommonFormat.doubleToString(12345.678)); }