### Question:
CsvUtils extends PentahoBase { protected String getLines( String fileLocation, int rows, String encoding ) { File file = new File( fileLocation ); InputStream in; InputStreamReader inr = null; StringBuilder line = new StringBuilder(); int count = 0; try { in = new FileInputStream( file ); inr = new InputStreamReader( in, encoding ); int c = inr.read(); boolean looking = true; while ( looking && c > 0 ) { line.append( (char) c ); if ( c == '\r' || c == '\n' ) { c = inr.read(); if ( c == '\r' || c == '\n' ) { line.append( (char) c ); c = inr.read(); } count++; if ( count == rows ) { looking = false; } } else { c = inr.read(); } } } catch ( IOException e ) { } finally { if ( inr != null ) { try { inr.close(); } catch ( IOException e ) { } } } return line.toString(); }  ModelInfo getFileContents( String project, String name, String delimiter, String enclosure, int rows,
                                    boolean isFirstRowHeader, String encoding ); ModelInfo generateFields( String project, String filename, int rowLimit, String delimiter, String enclosure,
                                   int headerRows, boolean doData, boolean doColumns, String encoding ); @Override Log getLogger(); String getEncoding( String fileName ); ModelInfo getModelInfo( String project, String filename ); static final List<String> NUMBER_FORMATS; static final String DEFAULT_RELATIVE_UPLOAD_FILE_PATH; static final String TMP_FILE_PATH; }### Answer:
@Test public void testGetLines() throws Exception { prepareFile( new String[] { "col1", "col2" } ); String lines = utils.getLines( tempFile.getAbsolutePath(), LINES_FOR_READ, "UTF-8" ); StringTokenizer tokenizer = new StringTokenizer( lines, DELIMETR ); assertNotNull( lines ); assertEquals( LINES_FOR_READ, tokenizer.countTokens() ); }