code: public static List<CharRange> removeOverlap(CharRange r1, CharRange r2)
      {
          assert r1.intersect(r2);
          List<CharRange> list = new ArrayList<CharRange>();
          Set<Integer> set = new TreeSet<Integer>();
          set.add(r1.getFrom());
          set.add(r1.getTo());
          set.add(r2.getFrom());
          set.add(r2.getTo());
          int p = 0;
          for (int r : set)
          {
              if (p != 0)
              {
                  list.add(new CharRange(p, r));
              }
              p = r;
          }
          return list;
      }
docs: Returns a list of ranges that together gather the same characters as r1 and r2.
  None of the resulting ranges doesn't intersect each other.
  @param r1
  @param r2
  @return