Source:
<code>public void createRules() { rule1.setRules( "[0,12)", <START> new LengthRule(8, 64), <END> new CharacterCharacteristicsRule( 4, new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.Special, 1), new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.setRules( "[12,16)", new LengthRule(8, 64), new CharacterCharacteristicsRule( 3, new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.setRules( "[16,20)", new LengthRule(8, 64), new CharacterCharacteristicsRule( 2, new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.setRules( "[20,1024]", new LengthRule(8, 64), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); }</code><technical_language>I surprised presence of explicit length rule, thought sense. I if range tied length rule in some way. cover password lengths ranges; if buy start range [8,12) end range [20,64]</technical_language>

Target:
public void createRules() { rule1.addRules( "[0,12)", new LengthRule(8, 64), new CharacterCharacteristicsRule( 4, new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.Special, 1), new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.addRules( "[12,16)", new LengthRule(8, 64), new CharacterCharacteristicsRule( 3, new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.addRules( "[16,20)", new LengthRule(8, 64), new CharacterCharacteristicsRule( 2, new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1)), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); rule1.addRules( "[20,128]", new LengthRule(8, 64), new UsernameRule(true, true), new IllegalSequenceRule(EnglishSequenceData.Alphabetical), new IllegalSequenceRule(EnglishSequenceData.Numerical), new IllegalSequenceRule(EnglishSequenceData.USQwerty), new RepeatCharacterRegexRule()); }