OCacheEntry cacheEntry = new OCacheEntry(0, 0, cachePointer, false);
try {
OClusterPage localPage = new OClusterPage(cacheEntry, true, ODurablePage.TrackMode.FULL);
Assert.assertEquals(localPage.getRecordsCount(), 0);
ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
recordVersion.increment();
int index = localPage.appendRecord(recordVersion, new byte[] { 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 }, false);
int freeSpace = localPage.getFreeSpace();
ORecordVersion newRecordVersion = OVersionFactory.instance().createVersion();
newRecordVersion.copyFrom(recordVersion);
newRecordVersion.increment();
int written = localPage.replaceRecord(index, new byte[] { 5, 2, 3, 4, 5, 11, 5, 4, 3, 2, 1, 3 }, newRecordVersion);
Assert.assertEquals(localPage.getFreeSpace(), freeSpace);
Assert.assertEquals(written, 11);