@Test
public void testFromJsonObject() {

	JsonArrayBuilder array = Json.createArrayBuilder();
	for (Point32 p : p1.getPoints()) {
		array.add(p.toJsonObject());
	}
	JsonObject jsonObject = Json.createObjectBuilder()
			.add(Polygon.FIELD_POINTS, array.build()).build();
	Polygon p = Polygon.fromJsonObject(jsonObject);
	assertEquals(p1.toString(), p.toString());
	assertEquals(p1.toJsonObject(), p.toJsonObject());
	assertEquals(p1.getMessageType(), p.getMessageType());
	assertTrue(Arrays.deepEquals(p1.getPoints(), p.getPoints()));
	assertNotSame(p1, p);
	assertNotSame(p1.toString(), p.toString());
	assertNotSame(p1.toJsonObject(), p.toJsonObject());
	assertEquals(p1.size(), p.size());
}