### Question:
Transport extends Emitter { protected void onClose() { mReadyState = ReadyState.CLOSED; emit("close"); } protected  Transport(); abstract void onRequest(HttpServletRequest request, HttpServletResponse response); abstract void send(List<Packet<?>> packets); abstract boolean isWritable(); abstract String getName(); void close();  }### Answer:
@Test public void testOnClose() { final TestTransport transport = Mockito.spy(new TestTransport()); transport.onClose(); assertEquals(transport.getState(), ReadyState.CLOSED); Mockito.verify(transport, Mockito.times(1)).emit("close"); }