### Question:
PoseArray extends Message { public static PoseArray fromMessage(Message m) { return PoseArray.fromJsonObject(m.toJsonObject()); } PoseArray();  PoseArray(Header header, Pose[] poses); int size(); Pose get(int index); Pose[] getPoses(); Header getHeader(); @Override PoseArray clone(); static PoseArray fromJsonString(String jsonString); static PoseArray fromMessage(Message m); static PoseArray fromJsonObject(JsonObject jsonObject); static final String FIELD_HEADER; static final String FIELD_POSES; static final String TYPE; }### Answer:
@Test public void testFromMessage() { Message m = new Message(p1.toString()); PoseArray p = PoseArray.fromMessage(m); assertEquals(p1.toString(), p.toString()); assertEquals(p1.toJsonObject(), p.toJsonObject()); assertEquals(p1.getMessageType(), p.getMessageType()); assertEquals(p1.getHeader(), p.getHeader()); assertTrue(Arrays.deepEquals(p1.getPoses(), p.getPoses())); assertNotSame(p1, p); assertNotSame(p1.toString(), p.toString()); assertNotSame(p1.toJsonObject(), p.toJsonObject()); assertEquals(p1.size(), p.size()); assertEquals(p1.get(0), p.get(0)); assertEquals(p1.get(1), p.get(1)); }