class PotOwnerTasksPreprocessor extends UserTasksPreprocessor {

    @SuppressWarnings("rawtypes")
    @Override
    public void preprocess(DataSetLookup lookup) {
        if (identityProvider == null || userGroupCallback == null) {
            return;
        }

        final List<String> groupsForUser = Optional.ofNullable(userGroupCallback.getGroupsForUser(identityProvider.getName())).orElse(new ArrayList<>());
        final List<Comparable> orgEntities = new ArrayList<>(groupsForUser);
        orgEntities.add(identityProvider.getName());

        final ColumnFilter myGroupFilter = AND(
                equalsTo(COLUMN_ORGANIZATIONAL_ENTITY, orgEntities),
                OR(equalsTo(COLUMN_ACTUALOWNER, ""), isNull(COLUMN_ACTUALOWNER)));

        final ColumnFilter columnFilter = AND(
                OR(isNull(COLUMN_EXCLUDED_OWNER), notEqualsTo(COLUMN_EXCLUDED_OWNER, identityProvider.getName())),
                OR(myGroupFilter, equalsTo(COLUMN_ACTUALOWNER, identityProvider.getName())));

        LOGGER.debug("Adding column filter: {}", columnFilter);

        if (lookup.getFirstFilterOp() != null) {
            lookup.getFirstFilterOp().addFilterColumn(columnFilter);
        } else {
            DataSetFilter filter = new DataSetFilter();
            filter.addFilterColumn(columnFilter);
            lookup.addOperation(filter);
        }

        super.preprocess(lookup);
    }

    public  PotOwnerTasksPreprocessor(IdentityProvider identityProvider,
                                     UserGroupCallback userGroupCallback,
                                     DataSetMetadata metadata);

}