function checkSetAndGetTextarea(start, end) {
  selection.setStart(textarea, start);
  selection.setEnd(textarea, end);
  assertEquals(start, selection.getStart(textarea));
  assertEquals(end, selection.getEnd(textarea));
}
Helper function to set the start and end and assert the getter values.