test_class.declarator: uniformPasswordService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private AccUniformPasswordService uniformPasswordService;
test_class.type: AccUniformPasswordService
test_class.var_name: uniformPasswordService
test_class.declarator: uniformPasswordSystemService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private AccUniformPasswordSystemService uniformPasswordSystemService;
test_class.type: AccUniformPasswordSystemService
test_class.var_name: uniformPasswordSystemService
test_class.file: Realization/backend/acc/src/test/java/eu/bcvsolutions/idm/acc/service/impl/DefaultAccUniformPasswordServiceTest.java
test_class.identifier: DefaultAccUniformPasswordServiceTest
test_class.superclass: extends AbstractPasswordFilterIntegrationTest
test_case.body: @Test
  	public void testFindOptionsSameSystemInTwoDefinition() {
  		SysSystemDto system = createSystem(false);
  		SysSystemDto systemTwo = createSystem(false);
  		SysSystemDto systemThree = createSystem(false);
  		IdmIdentityDto identity = createIdentity(system);
  
  		assignSystem(identity, systemTwo);
  		assignSystem(identity, systemThree);
  		
  		assignSystem(createUniformDefinition(false), system, systemTwo, systemThree);
  		assignSystem(createUniformDefinition(true), systemTwo);
  
  		List<AccPasswordChangeOptionDto> options = uniformPasswordService.findOptionsForPasswordChange(identity);
  		assertEquals(2, options.size());
  	}
test_case.class_method_signature: DefaultAccUniformPasswordServiceTest.testFindOptionsSameSystemInTwoDefinition()
test_case.full_signature: @Test public void testFindOptionsSameSystemInTwoDefinition()
test_case.identifier: testFindOptionsSameSystemInTwoDefinition
test_case.invocations: createSystem createSystem createSystem createIdentity assignSystem assignSystem assignSystem createUniformDefinition assignSystem createUniformDefinition findOptionsForPasswordChange assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindOptionsSameSystemInTwoDefinition()
focal_class.declarator: repository
focal_class.modifier: private final
focal_class.original_string: private final AccUniformPasswordRepository repository;
focal_class.type: AccUniformPasswordRepository
focal_class.var_name: repository
focal_class.declarator: accountService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private AccAccountService accountService;
focal_class.type: AccAccountService
focal_class.var_name: accountService
focal_class.declarator: uniformPasswordSystemService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private AccUniformPasswordSystemService uniformPasswordSystemService;
focal_class.type: AccUniformPasswordSystemService
focal_class.var_name: uniformPasswordSystemService
focal_class.file: Realization/backend/acc/src/main/java/eu/bcvsolutions/idm/acc/service/impl/DefaultAccUniformPasswordService.java
focal_class.identifier: DefaultAccUniformPasswordService
focal_class.interfaces: implements AccUniformPasswordService
focal_class.class_method_signature: DefaultAccUniformPasswordService.DefaultAccUniformPasswordService(AccUniformPasswordRepository repository,
  			EntityEventManager entityEventManager)
focal_class.full_signature: @Autowired public  DefaultAccUniformPasswordService(AccUniformPasswordRepository repository,
  			EntityEventManager entityEventManager)
focal_class.identifier: DefaultAccUniformPasswordService
focal_class.modifiers: @Autowired public
focal_class.parameters: (AccUniformPasswordRepository repository,
  			EntityEventManager entityEventManager)
focal_class.signature:  DefaultAccUniformPasswordService(AccUniformPasswordRepository repository,
  			EntityEventManager entityEventManager)
focal_class.class_method_signature: DefaultAccUniformPasswordService.getAuthorizableType()
focal_class.full_signature: @Override public AuthorizableType getAuthorizableType()
focal_class.identifier: getAuthorizableType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: AuthorizableType
focal_class.signature: AuthorizableType getAuthorizableType()
focal_class.class_method_signature: DefaultAccUniformPasswordService.getByCode(String code)
focal_class.full_signature: @Override public AccUniformPasswordDto getByCode(String code)
focal_class.identifier: getByCode
focal_class.modifiers: @Override public
focal_class.parameters: (String code)
focal_class.return: AccUniformPasswordDto
focal_class.signature: AccUniformPasswordDto getByCode(String code)
focal_class.class_method_signature: DefaultAccUniformPasswordService.findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)
focal_class.full_signature: @Override public List<AccPasswordChangeOptionDto> findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)
focal_class.identifier: findOptionsForPasswordChange
focal_class.modifiers: @Override public
focal_class.parameters: (IdmIdentityDto identity, BasePermission ...permissions)
focal_class.return: List<AccPasswordChangeOptionDto>
focal_class.signature: List<AccPasswordChangeOptionDto> findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)
focal_class.class_method_signature: DefaultAccUniformPasswordService.getNiceLabelForOption(AccAccountDto account)
focal_class.full_signature: private String getNiceLabelForOption(AccAccountDto account)
focal_class.identifier: getNiceLabelForOption
focal_class.modifiers: private
focal_class.parameters: (AccAccountDto account)
focal_class.return: String
focal_class.signature: String getNiceLabelForOption(AccAccountDto account)
focal_class.class_method_signature: DefaultAccUniformPasswordService.getNiceLabelForOption(AccUniformPasswordDto uniformPassword)
focal_class.full_signature: private String getNiceLabelForOption(AccUniformPasswordDto uniformPassword)
focal_class.identifier: getNiceLabelForOption
focal_class.modifiers: private
focal_class.parameters: (AccUniformPasswordDto uniformPassword)
focal_class.return: String
focal_class.signature: String getNiceLabelForOption(AccUniformPasswordDto uniformPassword)
focal_class.superclass: extends AbstractEventableDtoService<AccUniformPasswordDto, AccUniformPassword, AccUniformPasswordFilter>
focal_method.body: @Override
  	public List<AccPasswordChangeOptionDto> findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions) {
  		List<AccPasswordChangeOptionDto> result = Lists.newArrayList();
  		
  		AccUniformPasswordSystemFilter filter = new AccUniformPasswordSystemFilter();
  		filter.setIdentityId(identity.getId());
  		filter.setUniformPasswordDisabled(Boolean.FALSE);
  		List<AccUniformPasswordSystemDto> uniformPasswordSystems = this.uniformPasswordSystemService.find(filter, null).getContent();
  
  		// Group uniform password system by uniform password definition
  		Map<AccUniformPasswordDto, List<AccAccountDto>> accountsForUniformPassword = Maps.newHashMap();
  
  		// Same behavior as previous versions
  		AccAccountFilter accountFilter = new AccAccountFilter();
  		accountFilter.setOwnership(Boolean.TRUE);
  		accountFilter.setSupportChangePassword(Boolean.TRUE);
  		accountFilter.setIdentityId(identity.getId());
  		accountFilter.setInProtection(Boolean.FALSE);
  
  		// Include given permissions
  		List<AccAccountDto> accounts = accountService.find(accountFilter, null, permissions).getContent();
  		for (AccAccountDto account : accounts) {
  
  			// One system can be place more than one in uniform password systems
  			List<AccUniformPasswordSystemDto> uniformBySystem = uniformPasswordSystems.stream().filter(pfs -> {
  				return pfs.getSystem().equals(account.getSystem());
  			}).collect(Collectors.toList());
  
  			if (CollectionUtils.isEmpty(uniformBySystem)) {
  				// Simple account as option
  				AccPasswordChangeOptionDto optionDto = new AccPasswordChangeOptionDto(account);
  				optionDto.setNiceLabel(getNiceLabelForOption(account));
  				result.add(optionDto);
  				continue;
  			}
  
  			for (AccUniformPasswordSystemDto uniformPasswordSystemDto : uniformBySystem) {
  				AccUniformPasswordDto definition = DtoUtils.getEmbedded(uniformPasswordSystemDto, AccUniformPasswordSystem_.uniformPassword, AccUniformPasswordDto.class, null);
  				if (accountsForUniformPassword.containsKey(definition)) {
  					accountsForUniformPassword.get(definition).add(account);
  				} else {
  					accountsForUniformPassword.put(definition, Lists.newArrayList(account));
  				}
  			}
  
  		}
  
  		// Check if exists account for uniform password and process options for them
  		if (!accountsForUniformPassword.isEmpty()) {
  			for (Entry<AccUniformPasswordDto, List<AccAccountDto>> entry : accountsForUniformPassword.entrySet()) {
  				// There is also needed 
  				AccUniformPasswordDto uniformPasswordDto = entry.getKey();
  				AccPasswordChangeOptionDto optionDto = new AccPasswordChangeOptionDto(uniformPasswordDto, entry.getValue());
  				optionDto.setNiceLabel(getNiceLabelForOption(uniformPasswordDto));
  				optionDto.setChangeInIdm(uniformPasswordDto.isChangeInIdm());
  				
  				result.add(optionDto);
  			}
  		}
  
  		return result;
  	}
focal_method.class_method_signature: DefaultAccUniformPasswordService.findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)
focal_method.full_signature: @Override public List<AccPasswordChangeOptionDto> findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)
focal_method.identifier: findOptionsForPasswordChange
focal_method.invocations: newArrayList setIdentityId getId setUniformPasswordDisabled getContent find newHashMap setOwnership setSupportChangePassword setIdentityId getId setInProtection getContent find collect filter stream equals getSystem getSystem toList isEmpty setNiceLabel getNiceLabelForOption add getEmbedded containsKey add get put newArrayList isEmpty entrySet getKey getValue setNiceLabel getNiceLabelForOption setChangeInIdm isChangeInIdm add
focal_method.modifiers: @Override public
focal_method.parameters: (IdmIdentityDto identity, BasePermission ...permissions)
focal_method.return: List<AccPasswordChangeOptionDto>
focal_method.signature: List<AccPasswordChangeOptionDto> findOptionsForPasswordChange(IdmIdentityDto identity, BasePermission ...permissions)