### Question:
RecordChain implements Closeable, RecordCursor, Mutable, RecordSinkSPI { public void of(long nextRecordOffset) { this.nextRecordOffset = nextRecordOffset; } RecordChain(@Transient ColumnTypes columnTypes, RecordSink recordSink, long pageSize, int maxPages); long beginRecord(long prevOffset); @Override void clear(); @Override void close(); @Override Record getRecord(); @Override boolean hasNext(); @Override Record getRecordB(); @Override void recordAt(Record record, long row); @Override void toTop(); void of(long nextRecordOffset); long put(Record record, long prevRecordOffset); @Override void putBin(BinarySequence value); @Override void putBool(boolean value); @Override void putByte(byte value); @Override void putDate(long date); @Override void putDouble(double value); @Override void putFloat(float value); @Override void putInt(int value); @Override void putLong(long value); @Override void putLong256(Long256 value); @Override void putShort(short value); @Override void putChar(char value); @Override void putStr(CharSequence value); @Override void putStr(CharSequence value, int lo, int hi); @Override void putTimestamp(long value); void setSymbolTableResolver(RecordCursor resolver); @Override long size();  }### Answer:
@Test public void testWriteAndRead() throws Exception { TestUtils.assertMemoryLeak( () -> { final int N = 10000 * 2; CairoTestUtils.createTestTable(N, new Rnd(), new TestRecord.ArrayBinarySequence()); try (TableReader reader = new TableReader(configuration, "x")) { entityColumnFilter.of(reader.getMetadata().getColumnCount()); RecordSink recordSink = RecordSinkFactory.getInstance(asm, reader.getMetadata(), entityColumnFilter, false); try (RecordChain chain = new RecordChain(reader.getMetadata(), recordSink, 4 * 1024 * 1024L, Integer.MAX_VALUE)) { populateChain(chain, reader); assertChain(chain, N, reader); assertChain(chain, N, reader); } } } ); }