### Question:
EncryptedTokenSerializer implements TokenSerializer<String> { @Override public String deserialize(final String encodedStartKey) throws InvalidTokenException { try { return kms.decrypt(DecryptRequest.builder() .ciphertextBlob(SdkBytes.fromByteArray(base64Decode(encodedStartKey))) .build()) .plaintext() .asUtf8String(); } catch (InvalidCiphertextException e) { throw new InvalidTokenException("Failed to decrypt token:" + encodedStartKey, e); } }  @Override String deserialize(final String encodedStartKey); @Override String serialize(final String startKey);  }### Answer:
@Test public void deserialize_nonBase64() { assertThatThrownBy(() -> serializer.deserialize("something")) .isInstanceOf(InvalidTokenException.class); }