### Question:
Portfolio { protected final Map<String, Double> getChartSectorData() { if (chartSectorData == null) { final Map<String, Double> data = new HashMap<>(); for (final Equity equity : getEquities()) { if (equity.getCompany().getFund()) { addEquityValueToMap(data, Constants.FUND, equity); } else { final String sector = equity.getCurrentSector(); if (StringUtils.isEmpty(sector)) { addEquityValueToMap(data, Constants.UNKNOWN, equity); } else { addEquityValueToMap(data, sector, equity); } } } chartSectorData = new TreeMap<>(); chartSectorData.putAll(data); } return chartSectorData; } Portfolio(); final Double getTotalValue(); final Double getTotalPlusMinusValue(); final Double getTotalPlusMinusValueAbsolute(); final Double getYieldYear(); final Double getTotalGain(); final Double getYieldYearPerc(); final Date getLastCompanyUpdate(); final void setLastCompanyUpdate(final Date lastCompanyUpdate); final void compute(); final Double getTotalGainTodayAbsolute(); final List<String> getCompaniesYahooIdRealTime(); final void addIndexes(final List<Index> indexes); final String getPortfolioReview(); final IChart getPieChartSector(); final IChart getPieChartCap(); final IChart getTimeValueChart(); final IChart getTimeChart(); final Optional<Account> getAccount(final String name); final Optional<Account> getAccount(final int id); final Optional<Account> getFirstAccount(); final String getHTMLSectorByCompanies(); final String getHTMLCapByCompanies(); final Double getMaxShareValue(); final Date getMaxShareValueDate(); final Double getCurrentShareValuesYield(); final Double getCurrentShareValuesTaxes(); final Double getCurrentShareValuesVolume(); final Double getCurrenShareValuesGain(); final Double getCurrenShareValuesGainPorcentage(); final JsonObject getJSONObject();  }### Answer:
@Test public void testGetChartSectorData() { portfolio.setEquities(createEquities()); Map<String, Double> actual = portfolio.getChartSectorData(); assertNotNull(actual); assertEquals(25500d, actual.get(FUND), 0.1); assertEquals(4000d, actual.get(HIGH_TECH), 0.1); assertEquals(1000d, actual.get(UNKNOWN), 0.1); }