protected int chooseHighWaterMark(int capacity,double maxLoad){
  return Math.min(capacity - 2,(int)(capacity * maxLoad));
}

protected int chooseHighWaterMark ( int capacity , double maxLoad ) { return Math . min ( capacity - 2 , ( int ) ( capacity * maxLoad ) ) ; }
returns new high water mark threshold based on current capacity and maxloadfactor .
