code: public void setWaterMark(long curTime, long val) {
          lastSampleTime = curTime;
  
          if (!initWaterMark) {
              lowWaterMark = highWaterMark = val;
              initWaterMark = true;
          } else {
              if (val < lowWaterMark)
                  lowWaterMark = val;
  
              if (val > highWaterMark)
                  highWaterMark = val;
          }
          /*
           * if(val < lowWaterMark || lowWaterMark < 0)
           * lowWaterMark = val;
           * 
           * if(val > highWaterMark)
           * highWaterMark = val;
           */
          current = val;
      }
docs: /*
  Non-Synchronizable: counter is "replaced" with the input value. Caller should synchronize.