code: private void addGroup(List<Token> group, List<List<Token>> groups) {
  
      if(group.isEmpty()) return;
  
      // remove trailing tokens that should be ignored
      while(!group.isEmpty() && IGNORED_TRAILING_TOKENS.contains(
          group.get(group.size() - 1).getType())) {
        group.remove(group.size() - 1);
      }
  
      // if the group still has some tokens left, we'll add it to our list of groups
      if(!group.isEmpty()) {
        groups.add(group);
      }
    }
docs: Cleans up the given group and adds it to the list of groups if still valid
  @param group
  @param groups