question: public static < T > ArrayList < T > read ( InputStream fileStream , String charsetName , ITransformer < String , T > transformer ) throws FileNotFoundException { Scanner scanner = new Scanner ( fileStream , charsetName ) ; ArrayList < T > list = new ArrayList < > ( ) ; while ( scanner . hasNextLine ( ) ) { String line = scanner . nextLine ( ) ; list . add ( transformer . transform ( line ) ) ; } scanner . close ( ) ; return list ; }
target:  This function reads an InputStream line-by-line and converts each line into an object using a transformer that is passed as a parameter.