final Portfolio underlying = resolver.getPositionSource().getPortfolio(UniqueId.of("Portfolio", "0"), VersionCorrection.LATEST);
final Portfolio portfolio = new LazyResolvedPortfolio(new LazyResolveContext(resolver.getSecuritySource(), null).atVersionCorrection(VersionCorrection.LATEST), underlying);
assertEquals(portfolio.getAttributes(), underlying.getAttributes());
portfolio.setAttributes(ImmutableMap.of("K1", "V1", "K2", "V2"));
assertEquals(portfolio.getAttributes(), underlying.getAttributes());
portfolio.addAttribute("K3", "V3");
assertEquals(portfolio.getAttributes().size(), 3);
assertEquals(underlying.getAttributes().size(), 3);
assertEquals(portfolio.getName(), underlying.getName());
assertEquals(portfolio.getUniqueId(), underlying.getUniqueId());
assertEquals(portfolio.getRootNode().getUniqueId(), underlying.getRootNode().getUniqueId());