AbstractFileLineWriter implements FileLineWriter<T> { protected void setWriteData(boolean writeData) { this.writeData = writeData; } 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();  }
@Test public void testSetWriteData01() throws Exception { String fileName = "fileName"; Class<AbstractFileLineWriter_Stub01> clazz = AbstractFileLineWriter_Stub01.class; Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>(); columnFormatterMap.put("int", new IntColumnFormatter()); columnFormatterMap.put("java.lang.String", new NullColumnFormatter()); AbstractFileLineWriter<AbstractFileLineWriter_Stub01> fileLineWriter = new AbstractFileLineWriterImpl01<AbstractFileLineWriter_Stub01>(fileName, clazz, columnFormatterMap); ReflectionTestUtils.setField(fileLineWriter, "writeData", Boolean.FALSE); fileLineWriter.setWriteData(true); boolean resultBoolean = Boolean.class.cast(ReflectionTestUtils.getField( fileLineWriter, "writeData")); assertNotNull(resultBoolean); assertTrue(resultBoolean); }