code: public Pair<List<Node>, List<Node>> splitIntervalPattern(String raw) {
      List<Node> pattern = parse(raw);
  
      Set<Character> seen = new HashSet<>();
      List<Node> fst = new ArrayList<>();
      List<Node> snd = new ArrayList<>();
  
      // Indicates we've seen a repeated field.
      boolean boundary = false;
  
      for (Node node : pattern) {
        if (node instanceof Field) {
          char ch = ((Field) node).ch();
          if (seen.contains(ch)) {
            boundary = true;
          } else {
            seen.add(ch);
          }
        }
  
        if (boundary) {
          snd.add(node);
        } else {
          fst.add(node);
        }
      }
      return Pair.pair(fst, snd);
    }
docs: Looks for the first repeated field in the pattern, splitting it into
  two parts on that boundary.
  
  For example, the pattern "HH:mm - HH:mm v" will be split into two
  patterns:  "HH:mm - " and "HH:mm v" when we see the 'H' field for
  the 2nd time.