for (int i = 0; i < numOfMos; i++) {
inventory.create(aSampleMo().withName("MO" + i).with(new Coordinate()).build());
}
// When
ManagedObjectCollectionRepresentation mos = (ManagedObjectCollectionRepresentation) inventory.getManagedObjects().get();
// Then
assertThat(mos.getPageStatistics().getTotalPages()).isEqualTo(4);
// When
ManagedObjectCollectionRepresentation secondPage = (ManagedObjectCollectionRepresentation) inventory.getManagedObjects().getPage(mos, 2);
// Then
assertThat(secondPage.getPageStatistics().getCurrentPage()).isEqualTo(2);
// When
ManagedObjectCollectionRepresentation thirdPage = (ManagedObjectCollectionRepresentation) inventory.getManagedObjects().getNextPage(secondPage);
// Then
assertThat(thirdPage.getPageStatistics().getCurrentPage()).isEqualTo(3);
// When
ManagedObjectCollectionRepresentation firstPage = (ManagedObjectCollectionRepresentation) inventory.getManagedObjects().getPreviousPage(secondPage);
assertThat(firstPage.getPageStatistics().getCurrentPage()).isEqualTo(1);
}