GsonSerializer implements JsonSerializer { @Override public <T> T fromJson(String json, Class<T> targetClass) { return gson.fromJson(json, targetClass); } GsonSerializer(Gson gson); @Override T fromJson(String json, Class<T> targetClass); @Override String toJson(Object object);  }
@Test public void shouldProperlyDeserializeAnyGivenObject() throws Exception { Integer deserializedObject = gsonSerializer.fromJson("1080", Integer.class); assertThat(deserializedObject).isNotNull(); assertThat(deserializedObject).isInstanceOf(Integer.class); assertThat(deserializedObject).isEqualTo(1080); }