// get group field which is actually the first from sort fields
List<SortField2> groupFields = new ArrayList<SortField2>();
if (!sortFields.isEmpty())
groupFields.add(sortFields.get(0));
// create wrapper factory
ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(context,
table.getVar(), groupFields);
// create wrapper for last data
JavaBeanWrapper wrappedLstD = wrapperFactory.wrapObject(holder
.getLastData());
// create wrapper for current data
JavaBeanWrapper wrappedActD = wrapperFactory.wrapObject(table
.getRowData());
// create comparator
WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
(groupFields));
// compare last and current data