### Question:
EvseIdTypeAdapterDeserializer implements TypeAdapterDeserializer<EvseId> { @Override public EvseId deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("EvseId must be a JSON primitive"); } int evseId; try { evseId = json.getAsInt(); } catch (ClassCastException | IllegalStateException | NumberFormatException e) { throw new JsonParseException("EvseId must be a JSON integer", e); } return new EvseId(evseId); }  @Override EvseId deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context); @Override Class<?> getAdaptedType();  }### Answer:
@Test(expected = JsonParseException.class) public void testEvseIdAsObject() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("evseId", 1); adapter.deserialize(jsonObject, EvseId.class, null); }
@Test(expected = JsonParseException.class) public void testEvseIdAsUnparsableString() { JsonPrimitive jsonPrimitive = new JsonPrimitive("1x"); adapter.deserialize(jsonPrimitive, EvseId.class, null); }