### Question:
ExampleRecordSet implements RecordSet { @Override public RecordCursor cursor() { return new ExampleRecordCursor(columnHandles, byteSource); } ExampleRecordSet(ExampleSplit split, List<ExampleColumnHandle> columnHandles); @Override List<Type> getColumnTypes(); @Override RecordCursor cursor();  }### Answer:
@Test public void testCursorSimple() { RecordSet recordSet = new ExampleRecordSet(new ExampleSplit(dataUri), ImmutableList.of( new ExampleColumnHandle("text", createUnboundedVarcharType(), 0), new ExampleColumnHandle("value", BIGINT, 1))); RecordCursor cursor = recordSet.cursor(); assertEquals(cursor.getType(0), createUnboundedVarcharType()); assertEquals(cursor.getType(1), BIGINT); Map<String, Long> data = new LinkedHashMap<>(); while (cursor.advanceNextPosition()) { data.put(cursor.getSlice(0).toStringUtf8(), cursor.getLong(1)); assertFalse(cursor.isNull(0)); assertFalse(cursor.isNull(1)); } assertEquals(data, ImmutableMap.<String, Long>builder() .put("ten", 10L) .put("eleven", 11L) .put("twelve", 12L) .build()); }
@Test public void testCursorMixedOrder() { RecordSet recordSet = new ExampleRecordSet(new ExampleSplit(dataUri), ImmutableList.of( new ExampleColumnHandle("value", BIGINT, 1), new ExampleColumnHandle("value", BIGINT, 1), new ExampleColumnHandle("text", createUnboundedVarcharType(), 0))); RecordCursor cursor = recordSet.cursor(); Map<String, Long> data = new LinkedHashMap<>(); while (cursor.advanceNextPosition()) { assertEquals(cursor.getLong(0), cursor.getLong(1)); data.put(cursor.getSlice(2).toStringUtf8(), cursor.getLong(0)); } assertEquals(data, ImmutableMap.<String, Long>builder() .put("ten", 10L) .put("eleven", 11L) .put("twelve", 12L) .build()); }