### Question:
Quaternion extends Message { public static Quaternion fromMessage(Message m) { return Quaternion.fromJsonObject(m.toJsonObject()); } Quaternion();  Quaternion(double x, double y, double z, double w); double getX(); double getY(); double getZ(); double getW(); @Override Quaternion clone(); static Quaternion fromJsonString(String jsonString); static Quaternion fromMessage(Message m); static Quaternion fromJsonObject(JsonObject jsonObject); static final String FIELD_X; static final String FIELD_Y; static final String FIELD_Z; static final String FIELD_W; static final String TYPE; }### Answer:
@Test public void testFromMessage() { Message m = new Message(q1.toString()); Quaternion p = Quaternion.fromMessage(m); assertEquals(q1.toString(), p.toString()); assertEquals(q1.toJsonObject(), p.toJsonObject()); assertEquals(q1.getMessageType(), p.getMessageType()); assertEquals(q1.getX(), p.getX(), 0); assertEquals(q1.getY(), p.getY(), 0); assertEquals(q1.getZ(), p.getZ(), 0); assertEquals(q1.getW(), p.getW(), 0); assertNotSame(q1, p); assertNotSame(q1.toString(), p.toString()); assertNotSame(q1.toJsonObject(), p.toJsonObject()); }