final void waitForSizeQueue ( final int queueSize ) { synchronized ( this . queue ) { while ( this . queue . size ( ) > queueSize ) { try { this . queue . wait ( 250L ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } try { Thread . sleep ( 500L ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } this . queue . notifyAll ( ) ; } }
For test purposes only .