code: @Override
    public IScan getScanByNumClosest(int scanNum) {
      IScan result = null;
      Map.Entry<Integer, IScan> lower = getNum2scan().lowerEntry(scanNum);
      Map.Entry<Integer, IScan> upper = getNum2scan().ceilingEntry(scanNum);
      if (upper != null && lower != null) {
        result =
            Integer.compare(lower.getKey(), upper.getKey()) > 0 ? lower.getValue() : upper.getValue();
      } else if (upper != null) {
        result = upper.getValue();
      } else if (lower != null) {
        result = lower.getValue();
      }
      return result;
    }
docs: Scan with the closest Number is returned.
  
  @param scanNum scan number
  @return null might be returned in an extreme case when the scan collection is empty.