public static ExternalServiceCredentialsGenerator.Builder builder(final SecretBytes key) {
    return builder(key.value());
  }
@Test
  void testInvalidConstructor() {
    assertThrows(RuntimeException.class, () -> ExternalServiceCredentialsGenerator
        .builder(new byte[32])
        .withUsernameTimestampTruncatorAndPrefix(null, PREFIX)
        .build());

    assertThrows(RuntimeException.class, () -> ExternalServiceCredentialsGenerator
        .builder(new byte[32])
        .withUsernameTimestampTruncatorAndPrefix(timestamp -> timestamp.truncatedTo(ChronoUnit.DAYS), null)
        .build());
  }