FIXTimestamps { public static void append(ReadableDateTime t, StringBuilder s) { char[] buffer = BUFFER.get(); setDigits(buffer, t.getYear(), 0, 4); setDigits(buffer, t.getMonthOfYear(), 4, 2); setDigits(buffer, t.getDayOfMonth(), 6, 2); buffer[8] = '-'; setDigits(buffer, t.getHourOfDay(), 9, 2); buffer[11] = ':'; setDigits(buffer, t.getMinuteOfHour(), 12, 2); buffer[14] = ':'; setDigits(buffer, t.getSecondOfMinute(), 15, 2); buffer[17] = '.'; setDigits(buffer, t.getMillisOfSecond(), 18, 3); s.append(buffer); } private  FIXTimestamps(); static void append(ReadableDateTime t, StringBuilder s);  }
@Test public void append() { MutableDateTime timestamp = new MutableDateTime(2015, 9, 1, 9, 30, 5, 250); StringBuilder builder = new StringBuilder(); FIXTimestamps.append(timestamp, builder); assertEquals("20150901-09:30:05.250", builder.toString()); }