RandomPasswordGenerator { public static PasswordData createRandomPassword( final SessionLabel sessionLabel, final PwmPasswordPolicy passwordPolicy, final PwmApplication pwmApplication ) throws PwmUnrecoverableException { final RandomGeneratorConfig randomGeneratorConfig = RandomGeneratorConfig.builder() .passwordPolicy( passwordPolicy ) .build(); return createRandomPassword( sessionLabel, randomGeneratorConfig, pwmApplication ); } private  RandomPasswordGenerator( ); static PasswordData createRandomPassword(
            final SessionLabel sessionLabel,
            final PwmPasswordPolicy passwordPolicy,
            final PwmApplication pwmApplication
    ); static PasswordData createRandomPassword(
            final SessionLabel sessionLabel,
            final RandomGeneratorConfig randomGeneratorConfig,
            final PwmApplication pwmApplication
    ); static final Set<String> DEFAULT_SEED_PHRASES; }
@Test public void generateRandomPasswordsTest() throws PwmUnrecoverableException, IOException { final PwmApplication pwmApplication = TestHelper.makeTestPwmApplication( temporaryFolder.newFolder() ); final Map<String, String> policyMap = new HashMap<>( PwmPasswordPolicy.defaultPolicy().getPolicyMap() ); policyMap.put( PwmPasswordRule.AllowNumeric.getKey(), "true" ); final PwmPasswordPolicy pwmPasswordPolicy = PwmPasswordPolicy.createPwmPasswordPolicy( policyMap ); final int loopCount = 1_000; final Set<String> seenValues = new HashSet<>(); for ( int i = 0; i < loopCount; i++ ) { final PasswordData passwordData = RandomPasswordGenerator.createRandomPassword( null, pwmPasswordPolicy, pwmApplication ); final String passwordString = passwordData.getStringValue(); if ( seenValues.contains( passwordString ) ) { Assert.fail( "repeated random generated password" ); } seenValues.add( passwordString ); } }