### Question:
BeanGridDataSource implements GridDataSource { @Override public int getAvailableRows() { return sessionFactory.execute(new SessionCallback<Integer>() { @Override public Integer doInSession(Session session) { BeanQuery beanQuery = session.from(entityPath); if (conditions != null) { beanQuery.where(conditions); } return (int) beanQuery.count(); } }); } 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 GetAvailableRows() { assertEquals(250, dataSource.getAvailableRows()); }