{}
/* package */static PerformanceIndex calculate(Client client, Portfolio portfolio, ReportingPeriod reportInterval,
List<Exception> warnings)
{
Client pseudoClient = new Client();
Account pseudoAccount = new Account();
pseudoAccount.setName(""); //$NON-NLS-1$
pseudoClient.addAccount(pseudoAccount);
Portfolio pseudoPortfolio = new Portfolio();
pseudoPortfolio.setReferenceAccount(pseudoAccount);
pseudoClient.addPortfolio(pseudoPortfolio);
adaptPortfolioTransactions(portfolio, pseudoClient, pseudoPortfolio);
collectDividends(portfolio, pseudoClient, pseudoAccount);
return PerformanceIndex.forClient(pseudoClient, reportInterval, warnings);