@Test
public void testRegenerate() {

	String emailSuffix = "ex.tld";
	String emailSuffix1 = "@test.tld";
	String emailSuffix2 = "bcvsolutions.tld";
	String username = this.getHelper().createName();
	String email = "email@example.tdl";
	IdmIdentityDto identityDto = new IdmIdentityDto();
	identityDto.setFirstName(this.getHelper().createName());
	identityDto.setLastName(this.getHelper().createName());
	identityDto.setUsername(username);
	identityDto.setEmail(email);
	
	ValueGeneratorDto generator = getGenerator();
	// first
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString())), 10, Boolean.FALSE);
	// second
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix1,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString())), 20, Boolean.FALSE);
	// the last
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix2,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString())), 30, Boolean.FALSE);
	IdmIdentityDto generatedDto = valueGeneratorManager.generate(identityDto);
	assertNotNull(generatedDto.getEmail());
	assertEquals(email, generatedDto.getEmail());
}