for (int i = 0; i < 12; i++) {
MeasurementRepresentation rep = aSampleMeasurement((ManagedObjectRepresentation) managedObjects.get(0));
measurementApi.create(rep);
}
MeasurementCollectionRepresentation measurements = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().get();
MeasurementCollectionRepresentation page1st = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
measurements, 1);
MeasurementCollectionRepresentation page2nd = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
measurements, 2);
MeasurementCollectionRepresentation page3rd = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
measurements, 3);
MeasurementCollectionRepresentation page4th = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
measurements, 4);
assertThat(measurements.getMeasurements().size(), is(equalTo(5)));
assertThat(page1st.getMeasurements().size(), is(equalTo(5)));
assertThat(page2nd.getMeasurements().size(), is(equalTo(5)));
assertThat(page3rd.getMeasurements().size(), is(equalTo(2)));
assertThat(page4th.getMeasurements().size(), is(equalTo(0)));
}