PartitionedDataProvider implements ISortableDataProvider<List<T>, S> { @Override public void detach() { provider.detach(); } 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 testDetach() { final ISortableDataProvider provider = context.mock(ISortableDataProvider.class); final PartitionedDataProvider instance = new PartitionedDataProvider(provider, 2); context.checking(new Expectations() { { oneOf(provider).detach(); } }); instance.detach(); }