### Question:
InvestorService { public Stock addNewStockToTheInvestorPortfolio(String investorId, Stock newStock) { if (isPreConditionSuccess(investorId, newStock) && isNewStockInsertSucess(investorId, newStock)) { designForIntentCascadePortfolioAdd(investorId); return fetchSingleStockByInvestorIdAndStockSymbol(investorId, newStock.getSymbol()); } return null; }  List<Investor> fetchAllInvestors(); Investor fetchInvestorById(String investorId); List<Stock> fetchStocksByInvestorId(String investorId, int offset, int limit); Stock fetchSingleStockByInvestorIdAndStockSymbol(String investorId, String symbol); Stock addNewStockToTheInvestorPortfolio(String investorId, Stock newStock); boolean deleteStockFromTheInvestorPortfolio(String investorId, String stockTobeDeletedSymbol); Stock updateAStockByInvestorIdAndStock(String investorId, Stock stockTobeUpdated); Stock updateAStockByInvestorIdAndStock(String investorId, String symbol, Stock stockTobeUpdated);  }### Answer:
@Test public void testAddNewStocksToTheInvestorPortfolioFailsWhenTryInsertingDuplicate() { String investorId = "invr_1"; String actualStockSymbol = "EXe"; Stock actualStock = new Stock(actualStockSymbol, 150, 18.5); InvestorService localInvestorService = getInvestorServiceForTest(); assertNotNull(localInvestorService.addNewStockToTheInvestorPortfolio(investorId, actualStock)); assertNull(localInvestorService.addNewStockToTheInvestorPortfolio(investorId, actualStock)); }