### Question:
Duration extends Message { public static Duration fromJsonObject(JsonObject jsonObject) { edu.wpi.rail.jrosbridge.primitives.Duration data = jsonObject .containsKey(Duration.FIELD_DATA) ? edu.wpi.rail.jrosbridge.primitives.Duration .fromJsonObject(jsonObject.getJsonObject(Duration.FIELD_DATA)) : new edu.wpi.rail.jrosbridge.primitives.Duration(); return new Duration(data); } Duration();  Duration(edu.wpi.rail.jrosbridge.primitives.Duration data); edu.wpi.rail.jrosbridge.primitives.Duration getData(); @Override Duration clone(); static Duration fromJsonString(java.lang.String jsonString); static Duration fromMessage(Message m); static Duration fromJsonObject(JsonObject jsonObject); static final java.lang.String FIELD_DATA; static final java.lang.String TYPE; }### Answer:
@Test public void testFromJsonObject() { JsonObject jsonObject = Json.createObjectBuilder() .add(Duration.FIELD_DATA, t1.getData().toJsonObject()).build(); Duration data = Duration.fromJsonObject(jsonObject); assertEquals(t1.toString(), data.toString()); assertEquals(t1.toJsonObject(), data.toJsonObject()); assertEquals(t1.getMessageType(), data.getMessageType()); assertEquals(t1.getData(), data.getData()); assertNotSame(t1, data); assertNotSame(t1.toString(), data.toString()); assertNotSame(t1.toJsonObject(), data.toJsonObject()); }