FileUtils { public static List< String > readFile( final File file ) { final List< String > result = new ArrayList< String >(); BufferedReader inReader = null; try { final Reader reader = new InputStreamReader( new FileInputStream( file ), "UTF-8" ); inReader = new BufferedReader( reader ); String line = readLine( inReader ); while ( line != null ) { result.add( line ); line = readLine( inReader ); } inReader.close(); } catch ( final IOException e ) { StackTraceUtils.print( e ); } return result; } private  FileUtils(); static boolean isLineACorrectStatement( final String line ); static Collection< File > listFiles( final File directory,
                                               final FilenameFilter filter,
                                               final boolean recurse ); static Collection< File > listFiles( final List< File > sourceDirectory,
                                               final FilenameFilter filter,
                                               final boolean recurse ); static List< String > readFile( final File file ); static final Logger LOGGER; }
@Test public void testReadFile() throws IOException { assertEquals( 75, FileUtils.readFile( new File( "./src/test/resources/com/adobe/ac/ncss/mxml/IterationsList.mxml" ) ) .size() ); assertEquals( 0, FileUtils.readFile( new File( "./DoNotExistFile.as" ) ).size() ); }