### Question:
Duration extends TimeBase<Duration> { public static Duration fromJsonString(String jsonString) { return Duration.fromJsonObject(Json.createReader( new StringReader(jsonString)).readObject()); } Duration();  Duration(int secs, int nsecs);  Duration(double sec);  Duration(long nano); @Override Duration add(Duration d); @Override Duration subtract(Duration d); boolean sleep(); @Override Duration clone(); static Duration fromSec(double sec); static Duration fromNano(long nano); static Duration fromJsonString(String jsonString); static Duration fromJsonObject(JsonObject jsonObject); static final String TYPE; }### Answer:
@Test public void testFromJsonString() { Duration d = Duration.fromJsonString(d1.toString()); assertEquals(d1.toString(), d.toString()); assertEquals(d1.toJsonObject(), d.toJsonObject()); assertEquals(d1.getPrimitiveType(), d.getPrimitiveType()); assertEquals(d1.getSecs(), d.getSecs()); assertEquals(d1.getNsecs(), d.getNsecs()); assertEquals(d1.toSec(), d.toSec(), 0); assertEquals(d1.toNSec(), d.toNSec()); assertNotSame(d1, d); assertNotSame(d1.toString(), d.toString()); assertNotSame(d1.toJsonObject(), d.toJsonObject()); }