@Test
    public void test1() throws PersistitException {
        System.out.print("test1 ");

        final Exchange ex = _persistit.getExchange("persistit", "TransactionTest1", true);
        ex.removeAll();

        final Transaction txn = ex.getTransaction();

        txn.begin();
        try {
            for (int i = 0; i < 10; i++) {
                ex.getValue().put("String value #" + i + " for test1");
                ex.clear().append("test1").append(i).store();
            }
            for (int i = 3; i < 10; i += 3) {
                ex.clear().append("test1").append(i).remove(Key.GTEQ);
            }
            txn.commit();
        } finally {
            txn.end();
        }

        for (int i = -1; i < 12; i++) {
            ex.clear().append("test1").append(i).fetch();
            if ((i < 0) || (i >= 10) || ((i != 0) && ((i % 3) == 0))) {
                assertTrue(!ex.getValue().isDefined());
            } else {
                assertTrue(ex.getValue().isDefined());
                assertEquals(ex.getValue().get(), "String value #" + i + " for test1");
            }
        }

        txn.begin();
        try {
            ex.removeAll();
            txn.commit();
        } finally {
            txn.end();
        }
        for (int i = -1; i < 12; i++) {
            ex.clear().append("test1").append(i).fetch();
            assertTrue(!ex.getValue().isDefined());
        }

        txn.begin();
        try {
            ex.removeTree();
            txn.commit();
        } finally {
            txn.end();
        }
        assertTrue(!ex.getTree().isValid());
        try {
            ex.clear().append("test1").hasChildren();
            fail("Should have thrown an exception");
        } catch (Exception e) {
            // ok
        }

        System.out.println("- done");
    }