protected int recalculateFirst(int first, int pageSize, int rowCount) {
        if (rowCount > 0 && first >= rowCount) {
            int numberOfPages = (int) Math.ceil(rowCount * 1d / pageSize);
            first = Math.max((numberOfPages - 1) * pageSize, 0);
        }
        return first;
    }
Recalculates <code>first</code>, see #1921.
Also see: {@link org.primefaces.component.api.UIPageableData#calculateFirst()}

@param first the <code>first</code> param from the {@link #load(int, int, java.util.Map, java.util.Map)} method.
@param pageSize the <code>pageSize</code> param from the {@link #load(int, int, java.util.Map, java.util.Map)} method.
@param rowCount the new <code>rowCount</code>.
@return the recalculated <code>first</code>.
primefaces/src/main/java/org/primefaces/model/LazyDataModel.java