RuleSheetParserUtil { public static boolean isStringMeaningTrue(String property) { if ( property == null ) { return false; } else { property = property.trim(); if ( property.equalsIgnoreCase( "true" ) ) { return true; } else if ( property.startsWith( "Y" ) ) { return true; } else if ( property.startsWith( "y" ) ) { return true; } else if ( property.equalsIgnoreCase( "on" ) ) { return true; } else { return false; } } } 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 testIsStringMeaningTrue() { assertTrue( RuleSheetParserUtil.isStringMeaningTrue( "true" ) ); assertTrue( RuleSheetParserUtil.isStringMeaningTrue( "TRUE" ) ); assertTrue( RuleSheetParserUtil.isStringMeaningTrue( "yes" ) ); assertTrue( RuleSheetParserUtil.isStringMeaningTrue( "oN" ) ); assertFalse( RuleSheetParserUtil.isStringMeaningTrue( "no" ) ); assertFalse( RuleSheetParserUtil.isStringMeaningTrue( "false" ) ); assertFalse( RuleSheetParserUtil.isStringMeaningTrue( null ) ); }