question: protected boolean checkList ( String currentVal , String tokenValue ) { if ( currentVal == null || tokenValue == null ) { throw new NullPointerException ( "Received null argument" ) ; } if ( ! currentVal . startsWith ( "INLIST" ) && ! currentVal . startsWith ( "!INLIST" ) ) { throw new IllegalArgumentException ( "currentVal does not start with INLIST or !INLIST" ) ; } boolean negation = currentVal . startsWith ( "!" ) ; String listName = currentVal . substring ( currentVal . indexOf ( ":" ) + 1 ) ; Object listObj = listMap . get ( listName ) ; if ( listObj == null ) return false ; boolean contains ; if ( listObj instanceof Set ) { Set < String > set = ( Set ) listObj ; contains = set . contains ( tokenValue ) ; } else { throw new IllegalArgumentException ( "Unknown list representation: " + listObj ) ; } return ! ( contains && negation || ! contains && ! negation ) ; }
target:  Checks if tokenValue is contained in list. This base implementation is able to deal with list types represented as Sets; subclasses may override this method to be able to deal with different list representations.