### Question:
JsonHelperGson implements JsonHelper { @Override public <T> T parse(final String string, final Class<T> clazz) { try { if (StringUtils.isEmpty(string)) { return null; } return objectMapper.fromJson(string, clazz); } catch (Exception e) { throw handleException(e, "Json payload: " + string); } } JsonHelperGson();  JsonHelperGson(Gson objectMapper);  JsonHelperGson(Gson objectMapper, Gson prettyObjectMapper); static final Gson creatGson(boolean pretty); @Override T parse(final String string, final Class<T> clazz); @Override Object parse(String string); @Override List<T> parseList(String string, Class<T> clazz); @Override String print(final Object object); @Override String prettyPrint(Object object); @Override T convert(Object object, Class<T> instanceClass, String... path); @Override Integer getInteger(Object object, String... path); @Override String getString(Object object, String... path); @Override Long getLong(Object object, String... path); @Override @SuppressWarnings("squid:S2447") Boolean getBoolean(Object object, String... path); @Override BigInteger getBigInteger(Object object, String... path); @Override boolean contains(Object object, String... path); @Override Object getObject(Object object, String... path);  }### Answer:
@Test public void shouldFailWhenParsingInvalid() { Assertions.assertEquals( "JsonSyntaxException: java.io.EOFException: End of input at line 1 column 2 path $.. Json payload: {", Assertions.assertThrows( IllegalArgumentException.class, () -> jsonHelper.parse("{", Car.class)) .getMessage()); }
@Test public void shouldParseNull() { Assertions.assertNull(jsonHelper.parse(null)); Assertions.assertNull(jsonHelper.parse(null, Car.class)); }