private static boolean areGroupsEquivalent(RegExpGroup group1, RegExpGroup group2) {
    return group1.getType() == group2.getType() && arePatternsEquivalent(group1.getPattern(), group2.getPattern());
  }
private static boolean areGroupsEquivalent(RegExpGroup group1, RegExpGroup group2)