### Question:
JSONSerialisation { public <T> String serialise(T object) { try { String value = mapper.writeValueAsString(object); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to serialise {0}:{1}", object.getClass().getSimpleName(), object), e); } } @Inject  JSONSerialisation(@Named(CoreTokenConstants.OBJECT_MAPPER) ObjectMapper mapper); String serialise(T object); T deserialise(String text, Class<T> clazz); static String jsonAttributeName(String name);  }### Answer:
@Test public void basicSessionSerializationWorks() throws Exception { InternalSession is = new InternalSession(); String serialised = serialization.serialise(is); assertThat(serialised).isNotNull().isEqualTo(getJSON("/json/basic-session.json")); assertThat(is).isNotNull(); }