@Test
public void testPagination() {

  this.flagSettings.add(new FlagSetting("Name", "Desc", "Some", false));
  final MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
  params.putSingle("page[number]", "1");
  params.putSingle("page[size]", "1");
  final net.explorviz.shared.querying.Query<Setting> q =
      net.explorviz.shared.querying.Query.fromParameterMap(params);
  final Query<FlagSetting> qFlag = mock(Query.class);
  final Query<RangeSetting> qRange = mock(Query.class);
  when(this.ds.createQuery(FlagSetting.class)).thenReturn(qFlag);
  when(this.ds.createQuery(RangeSetting.class)).thenReturn(qRange);
  when(qFlag.asList()).thenReturn(this.flagSettings);
  when(qRange.asList()).thenReturn(this.rangeSettings);
  final QueryResult<Setting> res = this.sps.query(q);
  assertEquals(1, res.getData().size());
  assertEquals(0, res.getPreviousPage());
  assertEquals(2, res.getNextPage());
}