@SuppressWarnings({ "rawtypes", "unchecked" })

@Test
public void request_and_produce_a_future() {
    IoSession session = mock(IoSession.class);
    Request r = mock(Request.class);
    when(r.requestId()).thenReturn("ID");
    Map m = mock(Map.class);
    when(session.getAttribute(RequestFilter.IN_FLIGHT_REQUESTS)).thenReturn(m);
    // run
    IoFuture f = rq.request(session, r, 12345);
    // verify
    Assert.assertFalse(f.isDone());
    Assert.assertFalse(f.isCancelled());
    verify(r, times(2)).requestId();
    verify(session).write(r);
    verify(m).put("ID", f);
    verify(session).getAttribute(RequestFilter.IN_FLIGHT_REQUESTS);
    verifyNoMoreInteractions(session, m);
}