code: public static Interval parseInterval(String str) {
          String[] ss = str.split("-");
  
          Interval interval = new Interval();
          switch (ss.length) {
              case 1:
                  interval.start = Long.parseLong(ss[0]);
                  interval.stop = interval.start + 1;
                  break;
              case 2:
                  interval.start = Long.parseLong(ss[0]);
                  interval.stop = Long.parseLong(ss[1]) + 1;
                  break;
              default:
                  throw new RuntimeException(String.format("parseInterval failed due to wrong format: %s", str));
          }
  
          return interval;
      }
docs: 解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 =>
  Interval{start:1, stop:4} 注意！字符串格式表达时[n,m]是两侧都包含的，Interval表达时[n,m)右侧开
  
  @param str
  @return