public boolean addElement(T element) throws InterruptedException {
        lock.lock();
        try {
            while (isFull()) {
                emptyCondition.await();
            }

            boolean result = tasksQueue.add(element);
            fullCondition.signalAll();
            return result;
        } finally {
            lock.unlock();
        }
    }