Source:
public void createRules() { rule1.setRules( "[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.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()); }

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()); }