code: public synchronized Runnable removeAllocationThreshold(ThresholdDirection direction, long threshold) {
        switch (direction) {
          case RISING:
            return risingThresholds.remove(threshold);
          case FALLING:
            return fallingThresholds.remove(threshold);
        }
        throw new AssertionError();
      }
docs: Removes an allocation threshold action.
  <p>
  Removes the allocation threshold action for the given level and direction.
  
  @param direction registered actions direction
  @param threshold registered actions threshold level
  @return the removed condition or {@code null} if no action was present.