AbstractFileLineWriter implements FileLineWriter<T> { public void setColumnFormatterMap( Map<String, ColumnFormatter> columnFormatterMap) { this.columnFormatterMap = columnFormatterMap; } AbstractFileLineWriter(String fileName, Class<T> clazz,
            Map<String, ColumnFormatter> columnFormatterMap); @Override void printHeaderLine(List<String> headerLine); @Override void printDataLine(T t); @Override void printTrailerLine(List<String> trailerLine); @Override void closeFile(); String getFileName(); void setColumnFormatterMap(
            Map<String, ColumnFormatter> columnFormatterMap); abstract char getDelimiter(); abstract char getEncloseChar();  }
@SuppressWarnings("unchecked") @Test public void testSetColumnFormatterMap01() throws Exception { Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>(); columnFormatterMap.put("int", new IntColumnFormatter()); columnFormatterMap.put("java.lang.String", new NullColumnFormatter()); String fileName = "fileName"; Class<AbstractFileLineWriter_Stub01> clazz = AbstractFileLineWriter_Stub01.class; AbstractFileLineWriter<AbstractFileLineWriter_Stub01> fileLineWriter = new AbstractFileLineWriterImpl01<AbstractFileLineWriter_Stub01>(fileName, clazz, columnFormatterMap); ReflectionTestUtils.setField(fileLineWriter, "columnFormatterMap", null); fileLineWriter.setColumnFormatterMap(columnFormatterMap); Map<String, ColumnFormatter> resultMap = (Map<String, ColumnFormatter>) ReflectionTestUtils .getField(fileLineWriter, "columnFormatterMap"); assertNotNull(resultMap); assertSame(columnFormatterMap, resultMap); }