Dynamic pagination in java. Able to change and adapt.