code: public static String format(Date date) {
      Calendar calendar = new GregorianCalendar(TIMEZONE_Z, Locale.US);
      calendar.setTime(date);
  
      // estimate capacity of buffer as close as we can (yeah, that's pedantic ;)
      int capacity = "yyyy-MM-ddThh:mm:ss.sssZ".length();
      StringBuilder formatted = new StringBuilder(capacity);
      padInt(formatted, calendar.get(Calendar.YEAR), "yyyy".length());
      formatted.append('-');
      padInt(formatted, calendar.get(Calendar.MONTH) + 1, "MM".length());
      formatted.append('-');
      padInt(formatted, calendar.get(Calendar.DAY_OF_MONTH), "dd".length());
      formatted.append('T');
      padInt(formatted, calendar.get(Calendar.HOUR_OF_DAY), "hh".length());
      formatted.append(':');
      padInt(formatted, calendar.get(Calendar.MINUTE), "mm".length());
      formatted.append(':');
      padInt(formatted, calendar.get(Calendar.SECOND), "ss".length());
      formatted.append('.');
      padInt(formatted, calendar.get(Calendar.MILLISECOND), "sss".length());
      formatted.append('Z');
      return formatted.toString();
    }
docs: Returns {@code date} formatted as yyyy-MM-ddThh:mm:ss.sssZ