### Question:
GoalID extends Message { public static GoalID fromMessage(Message m) { return GoalID.fromJsonObject(m.toJsonObject()); } GoalID();  GoalID(Time stamp, String id); Time getStamp(); String getID(); @Override GoalID clone(); static GoalID fromJsonString(String jsonString); static GoalID fromMessage(Message m); static GoalID fromJsonObject(JsonObject jsonObject); static final String FIELD_STAMP; static final String FIELD_ID; static final String TYPE; }### Answer:
@Test public void testFromMessage() { Message m = new Message(g1.toString()); GoalID p = GoalID.fromMessage(m); assertEquals(g1.toString(), p.toString()); assertEquals(g1.toJsonObject(), p.toJsonObject()); assertEquals(g1.getMessageType(), p.getMessageType()); assertEquals(g1.getStamp(), p.getStamp()); assertEquals(g1.getID(), p.getID()); assertNotSame(g1, p); assertNotSame(g1.toString(), p.toString()); assertNotSame(g1.toJsonObject(), p.toJsonObject()); }