}
}
@Test
public void recyclesObjectArraysFromAlternatingCycles() throws Exception {
HeapFriendlyMapArrayRecycler recycler = HeapFriendlyMapArrayRecycler.get();
HeapFriendlyDerivableKeyHashMap<String, Integer> map = getMap(100);
Object[] firstSegment = getFirstSegment(map);
recycler.swapCycleObjectArrays();
map.releaseObjectArrays();
recycler.clearNextCycleObjectArrays();
map = getMap(100);
Object[] differentFirstSegment = getFirstSegment(map);
Assert.assertNotSame(firstSegment, differentFirstSegment);
recycler.swapCycleObjectArrays();
map.releaseObjectArrays();
recycler.clearNextCycleObjectArrays();
map = getMap(100);
Object[] firstSegmentAgain = getFirstSegment(map);
Assert.assertSame(firstSegment, firstSegmentAgain);
}