RuleSheetParserUtil { public static List<Import> getImportList(final List<String> importCells) { final List<Import> importList = new ArrayList<Import>(); if ( importCells == null ) return importList; for( String importCell: importCells ){ final StringTokenizer tokens = new StringTokenizer( importCell, "," ); while ( tokens.hasMoreTokens() ) { final Import imp = new Import(); imp.setClassName( tokens.nextToken().trim() ); importList.add( imp ); } } return importList; } private  RuleSheetParserUtil(); static String getRuleName(final String ruleRow); static List<Import> getImportList(final List<String> importCells); static List<Global> getVariableList( final List<String> variableCells ); static boolean isStringMeaningTrue(String property); static String rc2name( int row, int col );  }
@Test public void testListImports() { List<String> cellVals = null; List<Import> list = RuleSheetParserUtil.getImportList( cellVals ); assertNotNull( list ); assertEquals( 0, list.size() ); cellVals = new ArrayList<String>(); cellVals.add( "" ); assertEquals( 0, RuleSheetParserUtil.getImportList( cellVals ).size() ); cellVals.add( 0, "com.something.Yeah, com.something.No,com.something.yeah.*" ); list = RuleSheetParserUtil.getImportList( cellVals ); assertEquals( 3, list.size() ); assertEquals( "com.something.Yeah", (list.get( 0 )).getClassName() ); assertEquals( "com.something.No", (list.get( 1 )).getClassName() ); assertEquals( "com.something.yeah.*", (list.get( 2 )).getClassName() ); }