code: public static NumericalValue intersect (final NumericalValue a, final NumericalValue b) {
          // early exit
          if (a == null || b == null) return null;
          // get ranges of a and b
          int aMin, aMax, bMin, bMax;
          if (a instanceof SingleNumericalValue) {
              final SingleNumericalValue v = (SingleNumericalValue) a;
              aMin = v.getValue();
              aMax = aMin;
          } else {
              final NumericalValueRange r = (NumericalValueRange) a;
              aMin = r.getMin();
              aMax = r.getMax();
          }
          if (b instanceof SingleNumericalValue) {
              final SingleNumericalValue v = (SingleNumericalValue) b;
              bMin = v.getValue();
              bMax = bMin;
          } else {
              final NumericalValueRange r = (NumericalValueRange) b;
              bMin = r.getMin();
              bMax = r.getMax();
          }
          // intersect ranges
          final int min = Math.max(aMin, bMin);
          final int max = Math.min(aMax, bMax);
          if (min == max)
              return SingleNumericalValue.create(min);
          else
              return NumericalValueRange.create(min, max);
      }
docs: Returns a {@link NumericalValue} representing the intersection of the two parameters
  
  @param a the first {@link NumericalValue}
  @param b the second {@link NumericalValue}
  @return a {@link NumericalValue} representing the intersection of the two parameters