### Question:
CsvFileInfo extends XulEventSourceAdapter implements Serializable { public List<List<String>> parseSampleContents() { String delim = getDelimiter(); if ( contents == null ) { throw new IllegalStateException( "Sample Contents is null, nothing to parse" ); } else if ( delim == null || "".equals( delim ) ) { delim = "~!@#$%"; } List<List<String>> sample = new ArrayList<List<String>>(); CSVTokenizer csvTokenizer; String enclosure = null; if ( !"".equals( getEnclosure() ) ) { enclosure = getEnclosure(); } for ( String line : contents ) { csvTokenizer = new CSVTokenizer( line, delim, enclosure ); List<String> rowData = new ArrayList<String>(); while ( csvTokenizer.hasMoreTokens() ) { rowData.add( csvTokenizer.nextToken() ); } sample.add( rowData ); } return sample; }  @Bindable String getIfNull(); @Bindable void setIfNull( String ifNull ); @Bindable String getNullStr(); @Bindable void setNullStr( String nullStr ); @Bindable List<String> getContents(); @Bindable void setContents( List<String> contents ); @Bindable String getDelimiter(); @Bindable void setDelimiter( String delimiter ); @Bindable String getEnclosure(); @Bindable void setEnclosure( String enclosure ); @Bindable int getHeaderRows(); @Bindable void setHeaderRows( int headerRows ); @Bindable String getProject(); @Bindable void setProject( String project ); @Bindable String getTmpFilename(); @Bindable void setTmpFilename( String filename ); String getFilename(); void setFilename( String file ); @Bindable String getCurrencySymbol(); @Bindable void setCurrencySymbol( String currencySymbol ); @Bindable String getDecimalSymbol(); @Bindable void setDecimalSymbol( String decimalSymbol ); @Bindable String getGroupSymbol(); @Bindable void setGroupSymbol( String groupSymbol ); @Bindable String getEncoding(); @Bindable void setEncoding( String encoding ); void setEncodingFromServer( String encoding ); void setSavedEncoding( String encoding ); @Override int hashCode(); @Override boolean equals( Object obj ); List<List<String>> parseSampleContents(); String formatSampleContents(); @Bindable String getFriendlyFilename(); @Bindable void setFriendlyFilename( String friendlyFilename ); void clear(); static final String HEADER_ROWS_ATTRIBUTE; static final String ENCLOSURE_ATTRIBUTE; static final String DELIMITER_ATTRIBUTE; static final String TMP_FILENAME_ATTRIBUTE; static final String ENCODING; static final String DEFAULT_COLUMN_NAME_PREFIX; static final String FRIENDLY_FILENAME_ATTRIBUTE; }### Answer:
@Test public void testParseSampleContents() throws Exception { List<List<String>> parsed = csv.parseSampleContents(); assertEquals(6, parsed.size()); for (List<String> list : parsed) { System.out.println(list); assertEquals(9, list.size()); } }