@Test
  public void max_limit() {
    options.setLimit(42);
    assertThat(options.getLimit()).isEqualTo(42);

    options.setLimit(QueryContext.MAX_LIMIT + 10);
    assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
  }
 @Test
 public void with_zero_page_size() {
   options.setPage(1, 0);
   assertThat(options.getLimit()).isEqualTo(0);
   assertThat(options.getOffset()).isEqualTo(0);
   assertThat(options.getPage()).isEqualTo(0);
 }
 @Test
 public void page_starts_at_one() {
   options.setPage(1, 10);
   assertThat(options.getLimit()).isEqualTo(10);
   assertThat(options.getOffset()).isEqualTo(0);
   assertThat(options.getPage()).isEqualTo(1);
 }
  @Test
  public void page_shortcut_for_limit_and_offset() {
    options.setPage(3, 10);

    assertThat(options.getLimit()).isEqualTo(10);
    assertThat(options.getOffset()).isEqualTo(20);
  }
 @Test
 public void max_page_size() {
   options.setPage(3, QueryContext.MAX_LIMIT + 10);
   assertThat(options.getOffset()).isEqualTo(QueryContext.MAX_LIMIT * 2);
   assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
 }
 @Test
 public void set_max_limit() {
   options.setMaxLimit();
   assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
 }