### Question:
WebSocket implements AutoCloseable { void receiveString(String input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event: {}", input, e); throw new UncheckedIOException(e); } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); @Override void close();  }### Answer:
@Test public void receiveString() throws Exception { Message<String> event = new Message<String>(0, 1L, 2, 3L, "message"); String input = mapper.writeValueAsString(event); underTest.receiveString(input); verify(eventHandler).onEvent(event); }
@Test(expected = UncheckedIOException.class) public void receiveEmptyStringException() throws Exception { String inputUtf8 = ""; underTest.receiveString(inputUtf8); }