public static Document readDocument(@Nonnull final InputStream stream) throws ExecutionException, InterruptedException {
        return readDocumentAsync(stream).get();
    }
@Test
    public void testInputStream() throws Exception
    {
        // Setup test fixture.
        final InputStream input = new ByteArrayInputStream("<foo><bar>test</bar></foo>".getBytes(StandardCharsets.UTF_8));

        // Execute system under test.
        final Document output = SAXReaderUtil.readDocument(input);

        // Verify result.
        assertNotNull(output);
        assertEquals("foo", output.getRootElement().getName());
        assertNotNull(output.getRootElement().element("bar"));
        assertEquals("test", output.getRootElement().elementText("bar"));
    }