### Question:
Duration extends TimeBase<Duration> { public static Duration fromNano(long nano) { return new Duration(nano); } 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 testFromNano() { Duration d = Duration.fromNano(10200000000l); assertEquals(10, d.secs); assertEquals(200000000, d.nsecs); assertEquals(10, d.getSecs()); assertEquals(200000000, d.getNsecs()); assertFalse(d.isZero()); assertEquals(10.2, d.toSec(), 0); assertEquals(10200000000l, d.toNSec()); assertEquals("{\"secs\":10,\"nsecs\":200000000}", d.toString()); assertEquals(2, d.toJsonObject().size()); assertEquals(10, d.toJsonObject().getInt(TimeBase.FIELD_SECS)); assertEquals(200000000, d.toJsonObject().getInt(TimeBase.FIELD_NSECS)); assertEquals(Duration.TYPE, d.getPrimitiveType()); }