question: public void takeHints ( Collection < Hint > c , int maxElements ) throws InterruptedException { int count = 0 ; try { while ( count == 0 ) { hintLock . lock ( ) ; while ( hintQueue . isEmpty ( ) ) { hintsAvailable . await ( ) ; } while ( count < maxElements && ! hintQueue . isEmpty ( ) ) { HintKey hintKey = hintQueue . pollFirst ( ) ; if ( hintKey != null ) { List < Versioned < byte [ ] > > values = hints . remove ( hintKey ) ; if ( values == null ) { continue ; } c . add ( new Hint ( hintKey , values ) ) ; count += 1 ; } } } } finally { hintLock . unlock ( ) ; } }
target:  Drain up to the given number of hints to the provided collection. This method will block until at least one hint is available