public static Date parseDateTime(String s) {
    try {
      return Date.from(OffsetDateTime.parse(s, formatter).toInstant());
    } catch (DateTimeParseException e) {
      throw new IllegalArgumentException("Fail to parse date: " + s, e);
    }
  }
@Test
  public void fail_if_bad_format() {
    try {
      UtcDateUtils.parseDateTime("2014-01-14");
      fail();
    } catch (IllegalArgumentException e) {
      assertThat(e).hasMessage("Fail to parse date: 2014-01-14");
    }
  }