@Test
    public void testPackBias() throws Exception {
        final Exchange ex = _persistit.getExchange("persistit", "SplitPolicyTest", true);
        ex.getValue().put("aaabbbcccdddeee");
        ex.to(1);
        long page = ex.fetchBufferCopy(0).getPageAddress();
        final Buffer buffer = ex.getBufferPool().get(ex.getVolume(), page, false, true);
        buffer.releaseTouched();
        for (int i = 0; buffer.getAvailableSize() > 100; i++) {
            ex.to(i).store();
        }

        int mockRightSize = 20;
        int mockLeftSize = 20;
        int capacity = 0;
        SplitPolicy packBias = SplitPolicy.PACK_BIAS;
        assertEquals("PACK", packBias.toString());
        //
        // For non-sequential inserts, works the same as NICE_BIAS.
        //
        int measure = packBias.splitFit(buffer, 0, 0, false, mockLeftSize, mockRightSize, 0, 0, capacity, 0,
                Sequence.NONE);
        /*
         * splitFit should return 0 since rightSize & leftSize are larger than
         * capacity
         */
        assertEquals(0, measure);

        capacity = 21;
        measure = packBias.splitFit(buffer, 0, 0, false, mockLeftSize, mockRightSize, 0, 0, capacity, 0, Sequence.NONE);
        /*
         * splitFit returns ((capacity * 2) - abs((2 * rightSize) - leftSize))
         * for EVEN_BIAS policy
         */
        assertEquals(22, measure);

        capacity = 21;
        mockLeftSize = 5;
        mockRightSize = 15;
        measure = packBias.splitFit(buffer, 0, 0, false, mockLeftSize, mockRightSize, 0, 0, capacity, 0, Sequence.NONE);
        /*
         * splitFit returns ((capacity * 2) - abs((2 * rightSize) - leftSize))
         * for EVEN_BIAS policy
         */
        assertEquals(17, measure);

        //
        // Sequential insert cases
        //
        for (int p = buffer.getKeyBlockStart(); p < buffer.getKeyBlockEnd(); p += Buffer.KEYBLOCK_LENGTH) {
            int splitBest = split(packBias, buffer, p, Sequence.FORWARD);
            if (p > buffer.getKeyBlockStart() + 256 && p < buffer.getKeyBlockEnd() - 256) {
                assertEquals(splitBest, p);
            }
        }
        for (int p = buffer.getKeyBlockStart(); p < buffer.getKeyBlockEnd(); p += Buffer.KEYBLOCK_LENGTH) {
            int splitBest = split(packBias, buffer, p, Sequence.REVERSE);
            if (p > buffer.getKeyBlockStart() + 260 && p < buffer.getKeyBlockEnd() - 260) {
                assertEquals(splitBest, p + Buffer.KEYBLOCK_LENGTH);
            }
        }
    }