question: private < T > void runTestWrite ( XmlWriter < T > writer , List < T > bundle , List < String > expected ) throws Exception { File tmpFile = tmpFolder . newFile ( "foo.txt" ) ; try ( FileOutputStream fileOutputStream = new FileOutputStream ( tmpFile ) ) { writeBundle ( writer , bundle , fileOutputStream . getChannel ( ) ) ; } List < String > lines = new ArrayList < > ( ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( tmpFile ) ) ) { for ( ; ; ) { String line = reader . readLine ( ) ; if ( line == null ) { break ; } line = line . trim ( ) ; if ( line . length ( ) > 0 ) { lines . add ( line ) ; } } assertEquals ( expected , lines ) ; } }
target:  Write a bundle with an XmlWriter and verify the output is expected.