public static Document readDocument(@Nonnull final InputStream stream) throws ExecutionException, InterruptedException {
        return readDocumentAsync(stream).get();
    }
@Test
    public void testDocumentException() throws Exception
    {
        // Setup test fixture.
        final InputStream input = new ByteArrayInputStream("this is not valid XML".getBytes(StandardCharsets.UTF_8));

        final ExecutionException result;
        try {
            // Execute system under test.
            SAXReaderUtil.readDocument(input);
            fail("An ExecutionException should have been thrown.");
            return;
        } catch (ExecutionException e) {
            result = e;
        }

        // Verify result.
        assertNotNull(result);
        assertNotNull(result.getCause());
        assertEquals(DocumentException.class, result.getCause().getClass());
    }