@Test
public void testFutureResult() throws Exception {

    final FutureTask<Integer> futureTask = new FutureTask<Integer>(new Callable<Integer>() {
        @Override
        public Integer call() throws Exception {
            return 11;
        }
    });
    LastOperationMonitor opMonitor = new LastOperationMonitor();
    FutureOperationalResultImpl<Integer> futureResult =
            new FutureOperationalResultImpl<Integer>("test", futureTask, System.currentTimeMillis(), opMonitor);
    ExecutorService threadPool = Executors.newSingleThreadExecutor();
    threadPool.submit(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            Thread.sleep(400);
            futureTask.run();
            return null;
        }
    });
    OperationResult<Integer> opResult = futureResult.get();
    int integerResult = opResult.getResult();
    long latency = opResult.getLatency();
    Assert.assertEquals(11, integerResult);
    Assert.assertTrue(latency >= 400);
    threadPool.shutdownNow();
}