@Test
    public void testWrongThreadAssertion() throws Exception {
        boolean assertsEnabled = false;
        try {
            assert false;
        } catch (AssertionError e) {
            assertsEnabled = true;
        }
        if (!assertsEnabled) {
            // Does not count as a failure
            System.out.println("Test requires asserts enabled");
            return;
        }
        final AtomicReference<Exchange> ref = new AtomicReference<Exchange>();
        Thread thread = new Thread(new Runnable() {
            public void run() {
                try {
                    final Exchange exchange = _persistit.getExchange("persistit", "gogo", true);
                    ref.set(exchange);
                } catch (Exception e) {
                    // leave null ref
                }
            }
        });
        thread.start();
        thread.join();
        final Exchange exchange = ref.get();
        assertTrue("Failed to get an Exchange in background thread", exchange != null);
        // Verifies that all the parameter-less methods assert.
        int tested = 0;
        for (final Method m : Exchange.class.getMethods()) {
            if (m.getParameterTypes().length == 0 && m.getDeclaringClass().equals(Exchange.class)) {
                if ("toString".equals(m.getName())) {
                    continue;
                }
                try {
                    System.out.println("Testing " + m.getName());
                    m.invoke(exchange);
                    fail("Method " + m + " failed to throw an AssertionError");
                } catch (InvocationTargetException e) {
                    if (e.getCause() instanceof AssertionError) {
                        tested++;
                        // expected
                    } else {
                        throw e;
                    }
                }
            }
        }
        assertTrue("Not enough methods were tested: " + tested, tested > 10);
    }