public String toString() {
        // ensure minimum precision of 3 decimal places by using our own 3-decimal-place formatter when we have no nanos.
        final DateTimeFormatter formatter = (instant.getNano() == 0 ? ISO_INSTANT_MILLIS : DateTimeFormatter.ISO_INSTANT);
        return formatter.format(instant);
    }
@Test
    public void testParsingDateTimeWithCommaDecimalStyleLocale() throws Exception {
        final Locale germanLocale = Locale.GERMANY;
        final Clock germanClock = Clock.systemUTC().withZone(ZoneId.of("+02:00")); // DST doesn't matter

        // comma-decimal
        final Timestamp t1 = new Timestamp("2014-09-23T13:49:52,987654321Z", germanClock, germanLocale);
        assertEquals("2014-09-23T13:49:52.987654321Z", t1.toString());

        // fallback to stop-decimal
        final Timestamp t2 = new Timestamp("2014-09-23T13:49:52.987654321Z", germanClock, germanLocale);
        assertEquals("2014-09-23T13:49:52.987654321Z", t2.toString());
    }