@Test
    public void test2() throws PersistitException {
        System.out.print("test2 ");
        final Exchange ex = _persistit.getExchange("persistit", "TransactionTest3", true);
        ex.clear().append("test2").remove(Key.GTEQ);
        final String[] expectedKeys = { "{\"test2\",\"a\",0}", "{\"test2\",\"a\",1}", "{\"test2\",\"a\",2}",
                "{\"test2\",\"a\",3}", "{\"test2\",\"a\",4}", "{\"test2\",\"a\",5}", "{\"test2\",\"a\",7}",
                "{\"test2\",\"a\",8}", "{\"test2\",\"b\",0}", "{\"test2\",\"b\",1}", "{\"test2\",\"b\",2}",
                "{\"test2\",\"b\",4}", "{\"test2\",\"b\",5}", "{\"test2\",\"b\",6}", "{\"test2\",\"b\",7}",
                "{\"test2\",\"b\",8}", };

        for (int i = 0; i < 10; i++) {
            ex.getValue().put("String value #" + i + " for test2");
            ex.clear().append("test2").append("a").append(i).store();
            ex.clear().append("test2").append("b").append(i).store();
        }

        final Transaction txn = ex.getTransaction();
        txn.begin();
        try {
            for (int i = 3; i < 10; i += 3) {
                ex.clear().append("test2").append("a").append(i).remove(Key.GTEQ);
                ex.clear().append("test2").append("b").append(i).remove(Key.GTEQ);
            }

            ex.getValue().put("String value #" + 3 + " for test2 - pending");
            ex.clear().append("test2").append("a").append(3).store();
            ex.getValue().put("String value #" + 6 + " for test2 - pending");
            ex.clear().append("test2").append("b").append(6).store();

            ex.clear().append("test2");
            for (int index = 0; ex.traverse(Key.GT, true) && (index < expectedKeys.length); index++) {
                assertEquals(expectedKeys[index], ex.getKey().toString());
            }

            final boolean removed1 = ex.clear().append("test2").append("a").remove(Key.GTEQ);
            assertTrue(removed1);

            boolean removed2 = ex.clear().append("test2").append("c").remove(Key.GTEQ);
            assertTrue(!removed2);

            ex.clear().append("test2");
            for (int index = 8; ex.traverse(Key.GT, true) && (index < expectedKeys.length); index++) {
                assertEquals(expectedKeys[index], ex.getKey().toString());
            }

            txn.commit();
        } catch (final AssertionFailedError e) {
            System.out.println("Assertion failed: " + e);
            e.printStackTrace();
        } finally {
            txn.end();
        }

        ex.clear().append("test2");
        for (int index = 8; ex.traverse(Key.GT, true) && (index < expectedKeys.length); index++) {
            assertEquals(expectedKeys[index], ex.getKey().toString());
        }

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