code: public boolean contains(E p)
    {
      // Check that the start point is before p
      boolean check1 = (includesBegin())? (first.compareTo(p) <= 0):(first.compareTo(p) < 0);
      // Check that the end point is after p
      boolean check2 = (includesEnd())? (second.compareTo(p) >= 0):(second.compareTo(p) > 0);
      return (check1 && check2);
    }
docs: Checks whether the point p is contained inside this interval
  @param p point to check
  @return True if the point p is contained withing the interval, false otherwise