portSearchResult.setDocuments(Collections.singletonList(portfolioDocument));
// Masters to file
portfolioReader = new MasterPortfolioReader(PORTFOLIO_NAME, portfolioMaster, positionMaster, securitySource);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
portfolioWriter = new SingleSheetSimplePortfolioWriter(SheetFormat.CSV, outputStream, SECURITY_TYPE);
portfolioCopier.copy(portfolioReader, portfolioWriter);
portfolioReader.close();
portfolioWriter.close();
// Compare source and destination