@Test
public void validate_before_shouldThrow() throws Exception {

  String algo = "HS256";
  Clock clock = Clock.systemUTC();
  // This token cannot be used until 1 minute in the future.
  Instant notBefore = clock.instant().plus(Duration.ofMinutes(1));
  ToBeSignedJwt token =
      new ToBeSignedJwt.Builder().setAlgorithm(algo).setNotBefore(notBefore).build();
  JwtValidator validator = new JwtValidator.Builder().build();
  assertThrows(JwtNotBeforeException.class, () -> validator.validate(algo, token));
}