}
private PositionSource createPositionSource(final SecuritySource securities) {
final MockPositionSource positions = new MockPositionSource();
final SimplePortfolio portfolio = new SimplePortfolio("Test");
final SimplePortfolioNode root = portfolio.getRootNode();
// Portfolio node with position with a trade with an attribute
SimplePortfolioNode node = new SimplePortfolioNode("TradeAttr");
SimpleTrade trade = createTrade(securities);
trade.addAttribute("Present Value.DEFAULT_ForwardCurve", "FooForward");
trade.addAttribute("*.DEFAULT_FundingCurve", "FooFunding");
SimplePosition position = createPosition(securities);
position.addTrade(trade);
node.addPosition(position);
root.addChildNode(node);
// Portfolio node with position with a trade without an attribute
node = new SimplePortfolioNode("Trade");
trade = createTrade(securities);
position = createPosition(securities);
position.addTrade(trade);
node.addPosition(position);
root.addChildNode(node);
// Portfolio node with position with an attribute
node = new SimplePortfolioNode("PositionAttr");
position = createPosition(securities);
position.addAttribute("Present Value.DEFAULT_ForwardCurve", "FooForward");
position.addAttribute("*.DEFAULT_FundingCurve", "FooFunding");
node.addPosition(position);
root.addChildNode(node);
// Portfolio node with position without an attribute
node = new SimplePortfolioNode("Position");
position = createPosition(securities);
node.addPosition(position);
root.addChildNode(node);
portfolio.setUniqueId(UniqueId.of("Portfolio", "Test"));
positions.addPortfolio(portfolio);
return positions;
}