public static LlapAllocatorBuffer[] prepareZebraFragmentedAllocator(
      BuddyAllocator a, int baseSize, int pairCount, boolean doIncRef) {
    // Allocate 1-1-... xN; free every other one, allocate N/2 (or N/4).
    LlapAllocatorBuffer[] initial = allocate(a, pairCount * 2, baseSize, 1, doIncRef);
    for (int i = 0; i < pairCount; ++i) {
      a.deallocate(initial[i << 1]);
      initial[i << 1] = null;
    }
    LOG.info("Before: " + a.testDump());
    a.setOomLoggingForTest(true);
    return initial;
  }
This relies on allocations basically being sequential, no internal reordering. Rather,
the specific paths it takes do; all the scenarios should work regardless of allocation.
llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestBuddyAllocatorForceEvict.java