@Test
    public void testRebalanceException() throws Exception {

        setUpPrettyFullBuffers(Buffer.PAGE_TYPE_DATA, RED_FOX.length(), true);

        assertTrue(b1.verify(null, null) == null);
        assertTrue(b2.verify(null, null) == null);
        final int end1 = b1.getKeyBlockEnd();
        final int avail1 = b1.getAvailableSize();
        final int end2 = b2.getKeyBlockEnd();
        final int avail2 = b2.getAvailableSize();

        try {
            /*
             * Now attempt to join the two pages while removing the edge key
             */
            b1.join(b2, b1.getKeyBlockEnd() - 4, b2.getKeyBlockStart() + 4, ex.getAuxiliaryKey1(), ex
                    .getAuxiliaryKey2(), JoinPolicy.EVEN_BIAS);
            fail("RebalanceException not thrown");
        } catch (RebalanceException e) {
            // expected
        }

        // make sure the buffers weren't changed or corrupted

        assertTrue("Verify failed", b1.verify(null, null) == null);
        assertTrue("Verify failed", b2.verify(null, null) == null);
        assertEquals("RebalanceException modified the page", end1, b1.getKeyBlockEnd());
        assertEquals("RebalanceException modified the page", end2, b2.getKeyBlockEnd());
        assertEquals("RebalanceException modified the page", avail1, b1.getAvailableSize());
        assertEquals("RebalanceException modified the page", avail2, b2.getAvailableSize());
    }