question: @ PostConstruct public void init ( ) { Iterator < ValidatorFactory > iterator = validatorFactoryInstance . iterator ( ) ; if ( iterator . hasNext ( ) ) { this . validatorFactory = iterator . next ( ) ; } else { log . warning ( "Creating a ValidatorFactory because the container didn't provide one!" ) ; this . validatorFactory = Validation . buildDefaultValidatorFactory ( ) ; } }
target:  We should be able to get a ValidatorFactory from the container in an Java EE environment. However, if we don't get the factory, we will will use a default one. This is especially useful for non Java EE environments and in the CDI tests