if (vector.size() >= 5) {
if (vector.size() >= 10) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);
   public Object get() throws InterruptedException {      synchronized (lock) {         // wait until there is something to read         while (isEmpty())            lock.wait();         // just something here to try.         if (vector.size() >= 5) {            vector.remove(0);            vector.remove(0);            vector.remove(0);            vector.remove(0);         }            // we have the lock and state we're seeking         return vector.remove(0);      }   }