@Override
    public void run()
        {
            for(int i=0 ; i<pCapacity;i++)
            {
               if(i<list.getSize()){
                   list.addItems(rand.nextInt(45));
                   try {
                       Thread.sleep(rand.nextInt(30));
                   } catch (InterruptedException ex) {
                       Logger.getLogger(Producer.class.getName()).log(Level.SEVERE, null, ex);
                   }
               }
               else{Thread.yield();}
             }
         }