### Question:
Polygon extends Message { public static Polygon fromMessage(Message m) { return Polygon.fromJsonObject(m.toJsonObject()); } Polygon();  Polygon(Point32[] points); int size(); Point32 get(int index); Point32[] getPoints(); @Override Polygon clone(); static Polygon fromJsonString(String jsonString); static Polygon fromMessage(Message m); static Polygon fromJsonObject(JsonObject jsonObject); static final String FIELD_POINTS; static final String TYPE; }### Answer:
@Test public void testFromMessage() { Message m = new Message(p1.toString()); Polygon p = Polygon.fromMessage(m); assertEquals(p1.toString(), p.toString()); assertEquals(p1.toJsonObject(), p.toJsonObject()); assertEquals(p1.getMessageType(), p.getMessageType()); assertEquals(p1.size(), p.size()); assertTrue(Arrays.deepEquals(p1.getPoints(), p.getPoints())); assertNotSame(p1, p); assertNotSame(p1.toString(), p.toString()); assertNotSame(p1.toJsonObject(), p.toJsonObject()); }