final JsonRepresentation entityRepr = restResp.getEntity();
domainObjectRepr = entityRepr.as(DomainObjectRepresentation.class);
// and then members (types)
DomainObjectMemberRepresentation property;
ScalarValueRepresentation scalarRepr;
property = domainObjectRepr.getProperty("bigDecimalProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("big-decimal(30,10)"));
assertThat(property.getXIsisFormat(), is("javamathbigdecimal"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
BigDecimal bigDecimal = scalarRepr.asBigDecimal(property.getFormat());
assertThat(bigDecimal, is(new BigDecimal("12345678901234567890.1234567890")));
property = domainObjectRepr.getProperty("bigDecimalProperty2");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("big-decimal(18,2)"));
assertThat(property.getXIsisFormat(), is("javamathbigdecimal"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
BigDecimal bigDecimal2 = scalarRepr.asBigDecimal(property.getFormat());
assertThat(bigDecimal2, is(new BigDecimal("123.45")));
property = domainObjectRepr.getProperty("bigIntegerProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("big-integer(18)"));
assertThat(property.getXIsisFormat(), is("javamathbiginteger"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
BigInteger bigInteger = scalarRepr.asBigInteger(property.getFormat());
assertThat(bigInteger, is(new BigInteger("123456789012345678")));
property = domainObjectRepr.getProperty("bigIntegerProperty2");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("big-integer(18)"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
BigInteger bigInteger2 = scalarRepr.asBigInteger(property.getFormat());
assertThat(bigInteger2, is(new BigInteger("12345")));
property = domainObjectRepr.getProperty("javaSqlDateProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("date"));
assertThat(property.getXIsisFormat(), is("javasqldate"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
assertThat(scalarRepr.asString(), is("2014-04-24"));
assertThat(scalarRepr.asDate(), is(asDate("2014-04-24")));
property = domainObjectRepr.getProperty("javaSqlTimeProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("time"));
assertThat(property.getXIsisFormat(), is("javasqltime"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
assertThat(scalarRepr.asString(), is("12:34:45"));
assertThat(scalarRepr.asTime(), is(asDateTime("1970-01-01T12:34:45Z")));
property = domainObjectRepr.getProperty("javaSqlTimestampProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("utc-millisec"));
assertThat(property.getXIsisFormat(), is("javasqltimestamp"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isInt() || scalarRepr.isLong(), is(true));
Long aLong = scalarRepr.asLong();
assertThat(aLong, is(new Long("1234567890")));
property = domainObjectRepr.getProperty("javaUtilDateProperty");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("date-time"));
assertThat(property.getXIsisFormat(), is("javautildate"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
Date utilDate = scalarRepr.asDateTime();
assertThat(utilDate, is(asDateTime("2013-05-25T12:34:45Z")));
assertThat(scalarRepr.asString(), is("2013-05-25T12:34:45Z"));
property = domainObjectRepr.getProperty("myEnum");
assertThat(property.getMemberType(), is("property"));
assertThat(property.getFormat(), is("string"));
assertThat(property.getXIsisFormat(), is("string"));
scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
assertThat(scalarRepr.isString(), is(true));
String myEnumStr = scalarRepr.asString();
assertThat(myEnumStr, is("RED"));
}