### Question:
SockJsSession { public void onClose() { setState(State.CLOSED); service.onClose(); } SockJsSession(final String sessionId, final SockJsService service); ChannelHandlerContext connectionContext(); void setConnectionContext(final ChannelHandlerContext ctx); ChannelHandlerContext openContext(); void setOpenContext(final ChannelHandlerContext ctx); void setState(State newState); State getState(); boolean inuse(); void setInuse(final boolean use); SockJsConfig config(); String sessionId(); void onMessage(final String message); void onOpen(final SockJsSessionContext session); void onClose(); void addMessage(final String message); List<String> getAllMessages(); @SuppressWarnings("ManualArrayToCollectionCopy") void addMessages(final String[] messages); long timestamp(); @Override String toString();  }### Answer:
@Test public void onClose() throws Exception { final SockJsService service = mock(SockJsService.class); final SockJsSession sockJSSession = new SockJsSession("123", service); sockJSSession.onClose(); verify(service).onClose(); }