@Override
    public boolean filter(Object data) {

        logger.entering(new Object[] { data });
        invocationCount += 1;
        
        for (int index : this.indexes) {
            if (invocationCount == index) {
                logger.exiting(true);
                return true;
            }
        }
        logger.exiting(false);
        return false;
    }
@ Override public boolean filter ( Object data ) { logger . entering ( new Object [ ] { data } ) ; invocationCount += 1 ; for ( int index : this . indexes ) { if ( invocationCount == index ) { logger . exiting ( true ) ; return true ; } } logger . exiting ( false ) ; return false ; }
This function identifies whether the object falls in the filtering criteria or not based on the indexes provided.
For this we are using the invocation count for comparing the index.

@param data
the object to be filtered.
@return boolean - true if object falls in the filter criteria.