valve.close();
      public void run()      {         try         {            log.info("Starting Thread " + threadId);            synchronized (startSemaphore)            {               if (!started)               {                  startSemaphore.wait();               }            }            //log.info("Thread " + threadId + "Opening valve");            if (!valve.open())            {               //log.info("Valve couldn't be opened at thread " + threadId);               synchronized (VeryBasicValveTest.class)               {                  counterWait ++;               }            } else            {               //log.info("Thread " + threadId + " could open the valve");               //Thread.sleep(1000);               synchronized (VeryBasicValveTest.class)               {                  counter ++;               }            }            //log.info("Thread " + threadId + " is now closing the valve");            valve.close();         }         catch (Exception e)         {            e.printStackTrace();         }      }