### Question:
InvestorService { public Investor getInvestorByEmail(String email) throws InvestorNotFoundException { Optional<Investor> investorFromDb = investorRepository.findOptionalByEmail(email); return investorFromDb.orElseThrow(InvestorNotFoundException::new); } @Autowired  InvestorService(InvestorRepository investorRepository); Investor getInvestorByInvestorId(long investorId); Investor getInvestorByEmail(String email); List<Investor> getAllInvestors(); Investor getInvestorByBitcoinAddress(String address); Investor getInvestorByEthereumAddress(String address); @Transactional(propagation = Propagation.REQUIRES_NEW) Investor saveRequireNewTransaction(Investor investor);  }### Answer:
@Test public void testGetInvestorByEmail() { try { Investor investorFromDb = investorService.getInvestorByEmail("test@test.com"); assertEquals(investor, investorFromDb); } catch(InvestorNotFoundException e) { fail(e.getMessage()); } }