test_class.declarator: cleanupService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private CleanupService cleanupService;
test_class.type: CleanupService
test_class.var_name: cleanupService
test_class.declarator: bankService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private BankService bankService;
test_class.type: BankService
test_class.var_name: bankService
test_class.file: spring-ddd/spring-ddd-bank/src/test/java/de/beuth/knabe/spring_ddd_bank/domain/BankServiceTest.java
test_class.identifier: BankServiceTest
test_case.body: @Test
  	public void findRichClients() {
  		final Client kim = bankService.createClient("kim", LocalDate.parse("1994-05-21"));
  		final Client chloe = bankService.createClient("chloe", LocalDate.parse("1992-12-01"));
  		final AccountAccess kimAccount = kim.createAccount("Kim's Account");
  		final AccountAccess chloeAccount = chloe.createAccount("Chloe's Account");
  		kim.deposit(kimAccount.getAccount().accountNo(), new Amount(1000, 01));
  		chloe.deposit(chloeAccount.getAccount().accountNo(), new Amount(1000, 00));
  		{
  			// Expecting no clients:
  			final Iterable<Client> noClients = bankService.findRichClients(new Amount(1000, 02));
  			final String result = stringize(noClients);
  			assertEquals("", result);
  		}
  		{
  			// Expecting one client:
  			final Iterable<Client> oneClients = bankService.findRichClients(new Amount(1000, 01));
  			final String result = stringize(oneClients);
  			assertEquals("1994-05-21 kim", result);
  		}
  		{
  			// Expecting two clients, the richer should come first:
  			final Iterable<Client> twoClients = bankService.findRichClients(new Amount(1000, 00));
  			final String result = stringize(twoClients);
  			assertEquals("1994-05-21 kim, 1992-12-01 chloe", result);
  		}
  		chloe.deposit(chloeAccount.getAccount().accountNo(), new Amount(0, 01));
  		{
  			// Expecting two equally rich clients. The entity with the higher ID should be
  			// first.:
  			final Iterable<Client> twoClients = bankService.findRichClients(new Amount(1000, 01));
  			final String result = stringize(twoClients);
  			assertEquals("1992-12-01 chloe, 1994-05-21 kim", result);
  		}
  	}
test_case.class_method_signature: BankServiceTest.findRichClients()
test_case.full_signature: @Test public void findRichClients()
test_case.identifier: findRichClients
test_case.invocations: createClient parse createClient parse createAccount createAccount deposit accountNo getAccount deposit accountNo getAccount findRichClients stringize assertEquals findRichClients stringize assertEquals findRichClients stringize assertEquals deposit accountNo getAccount findRichClients stringize assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void findRichClients()
focal_class.declarator: clientRepository
focal_class.modifier: private final
focal_class.original_string: private final ClientRepository clientRepository;
focal_class.type: ClientRepository
focal_class.var_name: clientRepository
focal_class.declarator: accountAccessRepository
focal_class.modifier: private final
focal_class.original_string: private final AccountAccessRepository accountAccessRepository;
focal_class.type: AccountAccessRepository
focal_class.var_name: accountAccessRepository
focal_class.file: spring-ddd/spring-ddd-bank/src/main/java/de/beuth/knabe/spring_ddd_bank/domain/BankService.java
focal_class.identifier: BankService
focal_class.class_method_signature: BankService.BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository)
focal_class.full_signature: @Autowired public  BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository)
focal_class.identifier: BankService
focal_class.modifiers: @Autowired public
focal_class.parameters: (final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository)
focal_class.signature:  BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository)
focal_class.class_method_signature: BankService.createClient(final String username, final LocalDate birthDate)
focal_class.full_signature: public Client createClient(final String username, final LocalDate birthDate)
focal_class.identifier: createClient
focal_class.modifiers: public
focal_class.parameters: (final String username, final LocalDate birthDate)
focal_class.return: Client
focal_class.signature: Client createClient(final String username, final LocalDate birthDate)
focal_class.class_method_signature: BankService.deleteClient(final Client client)
focal_class.full_signature: public void deleteClient(final Client client)
focal_class.identifier: deleteClient
focal_class.modifiers: public
focal_class.parameters: (final Client client)
focal_class.return: void
focal_class.signature: void deleteClient(final Client client)
focal_class.class_method_signature: BankService.findClient(final String username)
focal_class.full_signature: public Client findClient(final String username)
focal_class.identifier: findClient
focal_class.modifiers: public
focal_class.parameters: (final String username)
focal_class.return: Client
focal_class.signature: Client findClient(final String username)
focal_class.class_method_signature: BankService.findAllClients()
focal_class.full_signature: public List<Client> findAllClients()
focal_class.identifier: findAllClients
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Client>
focal_class.signature: List<Client> findAllClients()
focal_class.class_method_signature: BankService.findYoungClients(final LocalDate fromBirth)
focal_class.full_signature: public List<Client> findYoungClients(final LocalDate fromBirth)
focal_class.identifier: findYoungClients
focal_class.modifiers: public
focal_class.parameters: (final LocalDate fromBirth)
focal_class.return: List<Client>
focal_class.signature: List<Client> findYoungClients(final LocalDate fromBirth)
focal_class.class_method_signature: BankService.findRichClients(final Amount minBalance)
focal_class.full_signature: public List<Client> findRichClients(final Amount minBalance)
focal_class.identifier: findRichClients
focal_class.modifiers: public
focal_class.parameters: (final Amount minBalance)
focal_class.return: List<Client>
focal_class.signature: List<Client> findRichClients(final Amount minBalance)
focal_method.body: public List<Client> findRichClients(final Amount minBalance) {
  		final List<AccountAccess> fullAccounts = accountAccessRepository.findFullAccounts(minBalance);
  		final Stream<Client> richClients = fullAccounts.stream().map(accountAccess -> accountAccess.getClient())
  				.distinct();
  		return richClients.collect(Collectors.toList());
  	}
focal_method.class_method_signature: BankService.findRichClients(final Amount minBalance)
focal_method.full_signature: public List<Client> findRichClients(final Amount minBalance)
focal_method.identifier: findRichClients
focal_method.invocations: findFullAccounts distinct map stream getClient collect toList
focal_method.modifiers: public
focal_method.parameters: (final Amount minBalance)
focal_method.return: List<Client>
focal_method.signature: List<Client> findRichClients(final Amount minBalance)