@VisibleForTesting
  static Instant getCreationTime(String configuredCreationTime, ProjectProperties projectProperties)
      throws DateTimeParseException, InvalidCreationTimeException {
    try {
      switch (configuredCreationTime) {
        case "EPOCH":
          return Instant.EPOCH;

        case "USE_CURRENT_TIMESTAMP":
          projectProperties.log(
              LogEvent.debug(
                  "Setting image creation time to current time; your image may not be reproducible."));
          return Instant.now();

        default:
          DateTimeFormatter formatter =
              new DateTimeFormatterBuilder()
                  .append(DateTimeFormatter.ISO_DATE_TIME) // parses isoStrict
                  // add ability to parse with no ":" in tz
                  .optionalStart()
                  .appendOffset("+HHmm", "+0000")
                  .optionalEnd()
                  .toFormatter();
          return formatter.parse(configuredCreationTime, Instant::from);
      }
    } catch (DateTimeParseException ex) {
      throw new InvalidCreationTimeException(configuredCreationTime, configuredCreationTime, ex);
    }
  }
@Test
  public void testGetCreationTime_isoDateTimeValue() throws InvalidCreationTimeException {
    Instant expected = DateTimeFormatter.ISO_DATE_TIME.parse("2011-12-03T01:15:30Z", Instant::from);
    List<String> validTimeStamps =
        ImmutableList.of(
            "2011-12-03T10:15:30+09:00",
            "2011-12-03T10:15:30+09:00[Asia/Tokyo]",
            "2011-12-02T16:15:30-09:00",
            "2011-12-03T10:15:30+0900",
            "2011-12-02T16:15:30-0900",
            "2011-12-03T10:15:30+09",
            "2011-12-02T16:15:30-09",
            "2011-12-03T01:15:30Z");
    for (String timeString : validTimeStamps) {
      Instant time = PluginConfigurationProcessor.getCreationTime(timeString, projectProperties);
      assertThat(time).isEqualTo(expected);
    }
  }