### Question:
DynamoDbStartKeySerializer implements TokenSerializer<Map<String, AttributeValue>> { @Override public Map<String, AttributeValue> deserialize(final String token) throws InvalidTokenException { if (StringUtils.isBlank(token)) { throw new InvalidTokenException("The token is blank."); } try { return OBJECT_MAPPER.readValue(token, new TypeReference<Map<String, AttributeValue>>() { }); } catch (IOException e) { throw new InvalidTokenException(String.format( "Failed to deserialize token %s from Json.", token), e); } }  @Override Map<String, AttributeValue> deserialize(final String token); @Override @SneakyThrows(JsonProcessingException.class) String serialize(final Map<String, AttributeValue> startKey);  }### Answer:
@Test public void deserialize_nonMap() { assertThatThrownBy(() -> serializer.deserialize("something")) .isInstanceOf(InvalidTokenException.class); }
@Test public void deserialize_blankString() { assertThatThrownBy(() -> serializer.deserialize(" ")) .isInstanceOf(InvalidTokenException.class); }