### Question:
TailSocket extends WebSocketAdapter { private void tail(File file, long bytesToTail, Mode mode) { stopTail(); this.tail = new Tail(getRemote(), file, bytesToTail, mode); this.executorService.execute(this.tail); } TailSocket(LogFiles logFiles); @Override void onWebSocketClose(int statusCode, String reason); @Override void onWebSocketText(String message);  }### Answer:
@Test public void testHandlingOfUnregisteredLogFile() throws Exception { tail("/does/not/exist"); sleepUpTo(1, SECONDS); verifyNoTextWasSent(); }
@Test(expected = RuntimeException.class) public void testHandlingOfIoException() throws Exception { withIoExceptionDuringLogfileResolution(); tail("/does/not/exist"); }