There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
Donec accumsan neque eget neque eleifend, et molestie enim tempus. Nulla iaculis nulla facilisis orci aliquet viverra. Maecenas vitae risus vitae neque ultrices molestie maximus vitae sapien. Sed sit amet tellus nec ipsum interdum vehicula eu eu lectus. Maecenas turpis nibh, rhoncus vitae sagittis ut, dignissim eget metus. Vestibulum cursus ultrices ex, ut lobortis velit porta vitae. Cras ultrices nunc nec imperdiet viverra.
Sed rutrum libero augue, ut congue urna venenatis in. Vestibulum mattis accumsan est, ut ullamcorper ante blandit a. Donec vestibulum elit placerat, tristique ex quis, sollicitudin quam. Nullam quis varius lorem, eu malesuada metus. Maecenas a ipsum suscipit, sodales velit at, consectetur nunc. Aenean commodo aliquam lacinia. Nulla mattis vulputate urna, at finibus urna gravida ac. Sed dignissim lectus velit. Vestibulum lobortis metus sit amet felis maximus porta. Nunc et viverra justo, id scelerisque quam.


In above example, shopper comes into picture solely when the producer
has filled up the queue upto its max measurement.
Since both threads have wait conditions they are going to
go there, now you just run it and see what it does, it is going to
most certainly print the output shown above. The second confusion comes from the fact that wait needs to be a call from a synchronized block or technique?
Why adding item to queue in produce and removing item from queue in consume not in synchronised block
(along with the notifies)? In such instances I cannot write such
an enormous synchronized block , as if producer-1 is creating Merchandise-1 , producer-2 cannot take lock
on queue and so two producers can't produce symultaniously.
With dangerous luck 2 producers call take away and there
may be test then act and NoSuchElementException is thrown.