I can't understand why do we synchronize get and put methods if ProducersTask and ConsumerTask run methods's already have a synchronized block: Why do we synchronize those:
public synchronized int get()
public synchronized void put(int value)
If we put them in synchronized blocks as in:
while(!stopped){
       synchronized (transferObject) {
            transferObject.put(i.incrementAndGet());
       }
}