### Question:
DefaultExecuteBlockingComponent implements IExecuteBlockingComponent { @Override public <T> void executeBlocking(IAsyncHandler<IAsyncFuture<T>> blockingCode, IAsyncResultHandler<T> resultHandler) { IAsyncFuture<T> wrapped = passthrough(resultHandler); try { blockingCode.handle(wrapped); } catch (Exception e) { wrapped.fail(e); } }  @Override void executeBlocking(IAsyncHandler<IAsyncFuture<T>> blockingCode, IAsyncResultHandler<T> resultHandler);  }### Answer:
@Test public void testSuccessfulExecution() { executeBlockingComponent.executeBlocking(future -> { future.completed("Coëtivy"); }, result -> { Assert.assertTrue(result.isSuccess()); Assert.assertFalse(result.isError()); Assert.assertEquals(result.getResult(), "Coëtivy"); Assert.assertNull(result.getError()); }); }
@Test public void testFailedExecution() { executeBlockingComponent.executeBlocking(future -> { future.fail(new ExampleException("Aldabra")); }, result -> { Assert.assertFalse(result.isSuccess()); Assert.assertTrue(result.isError()); Assert.assertTrue(result.getError() instanceof ExampleException); Assert.assertEquals(result.getError().getMessage(), "Aldabra"); Assert.assertNull(result.getResult()); }); }
@Test public void testExceptionInExecuteBlock() { executeBlockingComponent.executeBlocking(future -> { throw new ExampleException("Cosmoledo"); }, result -> { Assert.assertFalse(result.isSuccess()); Assert.assertTrue(result.isError()); Assert.assertTrue(result.getError() instanceof ExampleException); Assert.assertEquals(result.getError().getMessage(), "Cosmoledo"); Assert.assertNull(result.getResult()); }); }