### Question:
SerializerWrapper implements Serializer { @Override public <T> String writeObjectAsString(T object) throws IOException { ObjectWriter objectWriter = objectWriters.computeIfAbsent(object.getClass(), objectMapper::writerFor); return objectWriter.writeValueAsString(object); } SerializerWrapper(); @Override Parser newParser(InputStream inputStream); @Override String writeObjectAsString(T object);  }### Answer:
@Test @DisplayName("Serialise objects into JSON strings") void writeObjectAsStringTest() throws IOException { TestClass testObject1 = new TestClass(); testObject1.fieldInt = 42; testObject1.fieldString = "value"; String serialisedString1 = unit.writeObjectAsString(testObject1); assertThat(serialisedString1).isEqualToIgnoringWhitespace("{\"field-int\":42,\"field-string\":\"value\"}"); TestClass testObject2 = new TestClass(); testObject2.fieldInt = 73; testObject2.fieldString = null; String serialisedString2 = unit.writeObjectAsString(testObject2); assertThat(serialisedString2).isEqualToIgnoringWhitespace("{\"field-int\":73,\"field-string\":null}"); }