}
private void addToLeafPage(final LeafPage leafPage, final int position,
final int idValue, final int lastKeyValue,
final int numberOfKeyEntries) throws HeapException {
final MockDataBlock dataBlock = new MockDataBlock();
dataBlock.setPosition(position);
final DataRecordIdentifier dataRecordIdentifier = new DataRecordIdentifier(
idValue);
leafPage.add(dataRecordIdentifier, dataBlock);
assertEquals("must has " + numberOfKeyEntries + " entry",
numberOfKeyEntries, leafPage.getNumberOfKeyEntries());
assertEquals("bad byte size", byteSize(numberOfKeyEntries),
leafPage.getByteSize());
assertEquals("must find", dataBlock.getPositionInFile(),
leafPage.getDataBlockPosition(dataRecordIdentifier));
assertEquals("must not find", -1L,
leafPage.getDataBlockPosition(new DataRecordIdentifier(0)));
assertEquals("bad last key", new DataRecordIdentifier(lastKeyValue),
leafPage.getLastKey());