@Test
public void cancel() throws Exception {

    Window<Integer,String,String> window = new Window<Integer,String,String>(1);
    Integer i = new Integer(1);
    String request = "Request"+i;
    WindowFuture<Integer,String,String> requestFuture = window.offer(i, request, 100);
    
    // cancel it
    WindowFuture<Integer,String,String> responseFuture = window.cancel(i);
    Assert.assertEquals(new Integer(i), responseFuture.getKey());
    Assert.assertEquals(request, responseFuture.getRequest());
    Assert.assertEquals(true, responseFuture.getAcceptTimestamp() > 0);
    Assert.assertEquals(null, responseFuture.getResponse());
    Assert.assertEquals(true, responseFuture.getDoneTimestamp() > 0);
    Assert.assertEquals(true, requestFuture.isCancelled());
    Assert.assertEquals(true, requestFuture.isDone());
    Assert.assertEquals(false, requestFuture.isSuccess());
    Assert.assertTrue(requestFuture.getAcceptToDoneTime() >= 0);
    // this should not timeout waiting for a response
    Assert.assertTrue(requestFuture.await(50));
}