### Question:
Literals { public static Literal<? extends Serializable> newLiteral(Object value) { checkNotNull(value,LITERAL_VALUE_CANNOT_BE_NULL); Literal<? extends Serializable> result=null; if(isDuration(value)) { result=coherceDuration(value); } else if(isDateTime(value)) { result=coherceDateTime(value,Datatypes.DATE_TIME); } else if(value instanceof Serializable) { result=new ImmutableLiteral<Serializable>((Serializable)value); } else { result=new ImmutableTypedLiteral<String>(value.toString(),Datatypes.STRING); } return result; } 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 public void testNewLiteral$temporal$date() { checkNewLiteral( TimeUtils. newInstance(). from(this.dateTime.get()). toDate()); }
@Test public void testNewLiteral$temporal$sqlDate() { checkNewLiteral( Datatypes.DATE, TimeUtils. newInstance(). from(this.dateTime.get()). toSqlDate()); }
@Test public void testNewLiteral$temporal$sqlTime() { checkNewLiteral( Datatypes.TIME, TimeUtils. newInstance(). from(this.dateTime.get()). toSqlTime()); }
@Test public void testNewLiteral$temporal$calendar() { checkNewLiteral(nonGregorianCalendar()); }
@Test public void testNewLiteral$temporal$dateTime() { checkNewLiteral(this.dateTime.get()); }
@Test public void testNewLiteral$nonTemporal$serializable() { SerializableData data = new SerializableData(); Literal<? extends Serializable> literal = Literals.newLiteral(data); assertThat(literal.get(),sameInstance((Serializable)data)); if(literal instanceof TypedLiteral<?>) { assertThat(((TypedLiteral<?>)literal).type(),equalTo(Datatypes.STRING)); } }
@Test public void testNewLiteral$nonTemporal$notSerializable() { NotSerializableData data = new NotSerializableData(); Literal<? extends Serializable> literal = Literals.newLiteral(data); assertThat(literal.get(),equalTo((Serializable)data.toString())); if(literal instanceof TypedLiteral<?>) { assertThat(((TypedLiteral<?>)literal).type(),equalTo(Datatypes.STRING)); } }
@Test public void testNewLiteral$duration$jodaDuration() { checkDurationLiteral(Literals.newLiteral(jodaDuration())); }
@Test public void testNewLiteral$duration$javaDuration() throws DatatypeConfigurationException { checkDurationLiteral(Literals.newLiteral(javaDuration())); }