### Question:
BeanGridDataSource implements GridDataSource { @Override public void prepare(final int start, final int end, final List<SortConstraint> sortConstraints) { Assert.notNull(sortConstraints, "sortContraints"); sessionFactory.execute(new SessionCallback<Void>() { @Override public Void doInSession(Session session) { prepare(session, start, end, sortConstraints); return null; } }); } BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive); @SuppressWarnings("unchecked")  BeanGridDataSource(SessionFactory sessionFactory, EntityPath<T> entity, OrderSpecifier<?> defaultOrder, boolean caseSensitive, @Nullable Predicate conditions); @Override int getAvailableRows(); @Override void prepare(final int start, final int end, final List<SortConstraint> sortConstraints); @Override Object getRowValue(int index); @Override Class<?> getRowType();  }### Answer:
@Test public void Prepare() { dataSource.prepare(0, 10, Collections.<SortConstraint> emptyList()); }
@Test public void Prepare_with_sort() { PropertyModel firstName = new SimplePropertyModel("firstName", String.class); SortConstraint constraint = new SortConstraint(firstName, ColumnSort.ASCENDING); dataSource.prepare(0, 10, Collections.singletonList(constraint)); }