PartitionedDataProvider implements ISortableDataProvider<List<T>, S> { @Override public ISortState<S> getSortState() { return provider.getSortState(); } PartitionedDataProvider(ISortableDataProvider<T, S> provider, int partitionSize); @Override Iterator<? extends List<T>> iterator(long first, long count); @Override long size(); @Override IModel<List<T>> model(List<T> object); @Override void detach(); @Override ISortState<S> getSortState();  }
@Test public void testGetSortState() { final ISortableDataProvider provider = context.mock(ISortableDataProvider.class); final PartitionedDataProvider instance = new PartitionedDataProvider(provider, 2); final ISortState sortState = context.mock(ISortState.class); context.checking(new Expectations() { { oneOf(provider).getSortState(); will(returnValue(sortState)); } }); assertSame(sortState, instance.getSortState()); }