List<Position> positions = new ArrayList<Position>();
positions.add(instrumentPosition);
positions.add(cashPosition);
BrokerageAccountSummary summary1 = new BrokerageAccountSummary(
ACCOUNT_ID,
ACCOUNT_NAME,
CASH_IN_ACCOUNT,
CASH_IN_ACCOUNT.plus(instrumentPosition.getMarketValue()),
true,
true,
true,
positions);
ObjectMapper mapper =
new ObjectMapperProvider().getContext(ObjectMapper.class);
String json1 = mapper.writeValueAsString(summary1);
// System.out.println(json1);
BrokerageAccountSummary summary2 =
mapper.readValue(json1, BrokerageAccountSummary.class);
Assert.assertEquals(summary2, summary1);
}