DateTypeConverters { @Nullable @TypeConverter public static String fromInstant(Instant instant) { if (instant == null) { return null; } else { return instant.toString(); } } private  DateTypeConverters(); @Nullable @TypeConverter static OffsetDateTime toOffsetDateTime(@Nullable String sqlValue); @Nullable @TypeConverter static String fromOffsetDateTime(@Nullable OffsetDateTime dateTime); @Nullable @TypeConverter static String fromInstant(Instant instant); @Nullable @TypeConverter static Instant toInstant(String value);  }
@Test public void fromInstant() { Instant now = Instant.now(); assertEquals(now.toString(), DateTypeConverters.fromInstant(now)); }
@Test public void fromInstantNull() { assertNull(DateTypeConverters.fromInstant(null)); }