### Question:
Literals { public static DurationLiteral duration(long time, TimeUnit unit) { checkNotNull(time,TIME_CANNOT_BE_NULL); checkNotNull(unit,TIME_UNIT_CANNOT_BE_NULL); return of(new Duration(TimeUnit.MILLISECONDS.convert(time, unit))); } private  Literals(); static Literal<String> of(String value); static DurationLiteral of(javax.xml.datatype.Duration duration); static DurationLiteral of(Duration duration); static DateTimeDateTimeLiteralBuilder of(Date date); static DateTimeLiteral of(java.sql.Date date); static DateTimeLiteral of(java.sql.Time time); static DateTimeDateTimeLiteralBuilder of(Calendar calendar); static DateTimeDateTimeLiteralBuilder of(GregorianCalendar calendar); static XMLGregorianCalendarDateTimeLiteralBuilder of(XMLGregorianCalendar calendar); static DateTimeDateTimeLiteralBuilder of(DateTime dateTime); static DurationLiteral duration(long time, TimeUnit unit); static Literal<? extends Serializable> newLiteral(Object value); static TypedLiteral<? extends Serializable> newTypedLiteral(Object value, URI datatype); static LanguageLiteral newLanguageLiteral(String value, String language);  }### Answer:
@Test(expected=NullPointerException.class) public void testDuration$nullUnit() { Literals.duration(0l, null); }
@Test public void testDuration$negativeDuration() { DurationLiteral nwl=Literals.duration(-1,TimeUnit.DAYS); assertThat(nwl,notNullValue()); assertThat(nwl.get(),equalTo(new Duration(-24*60*60*1000))); }
@Test public void testDuration$regularDuration() { DurationLiteral nwl = Literals.duration(1,TimeUnit.DAYS); assertThat(nwl,notNullValue()); assertThat(nwl.get(),equalTo(new Duration(24*60*60*1000))); }
@Test(expected=NullPointerException.class) public void testOf$duration$null() { Literals.of((javax.xml.datatype.Duration)null); }