@Test
    public void requireThatAsyncSessionWorks() throws InterruptedException {
        AsyncSession session = access().createAsyncSession(new AsyncParameters());
        HashMap<Long, Response> results = new LinkedHashMap<>();
        Result result;
        DocumentType type = access().getDocumentTypeManager().getDocumentType("music");
        Document doc1 = new Document(type, new DocumentId("id:ns:music::1"));
        Document doc2 = new Document(type, new DocumentId("id:ns:music::2"));

        result = session.put(doc1);
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new Response(result.getRequestId()));
        result = session.put(doc2);
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new Response(result.getRequestId()));

        List<Response> responses = new ArrayList<>();
        waitForAcks(session, 2, responses);

        result = session.get(new DocumentId("id:ns:music::1"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId(), doc1));
        result = session.get(new DocumentId("id:ns:music::2"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId(), doc2));
        // These Gets shall observe the ACKed Puts sent for the same document IDs.
        waitForAcks(session, 2, responses);

        result = session.remove(new DocumentId("id:ns:music::1"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new Response(result.getRequestId()));
        waitForAcks(session, 1, responses);

        result = session.get(new DocumentId("id:ns:music::1"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId()));
        result = session.get(new DocumentId("id:ns:music::2"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId(), doc2));
        waitForAcks(session, 2, responses);

        result = session.remove(new DocumentId("id:ns:music::2"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new Response(result.getRequestId()));
        waitForAcks(session, 1, responses);

        result = session.get(new DocumentId("id:ns:music::1"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId()));
        result = session.get(new DocumentId("id:ns:music::2"));
        assertTrue(result.isSuccess());
        results.put(result.getRequestId(), new DocumentResponse(result.getRequestId()));
        waitForAcks(session, 2, responses);

        for (Response response : responses) {
            assertTrue(response.isSuccess());
            assertEquals(results.get(response.getRequestId()), response);
        }

        session.destroy();
    }
These tests should work with all implementations (who choose to implement these features) To test a certain
implementation subclass this test and make the subclass setup assign the implementation class to the
<code>access</code> member variable (make sure it also calls super.setUp()). Override tests of nonsupported features
to do nothing.

@author bratseth
documentapi/src/test/java/com/yahoo/documentapi/test/AbstractDocumentApiTestCase.java