code: private static boolean equal(int[] prod1, int[] prod2) {
          int ofs;
  
          if (prod1.length != prod2.length) {
              return false;
          }
          for (ofs = 0; ofs < prod1.length; ofs++) {
              if (prod1[ofs] != prod2[ofs]) {
                  if (!((prod1[ofs] == prod1[0]) && (prod2[ofs] == prod2[0]))) {
                      return false;
                  }
              }
          }
          return true;
      }
docs: TODO: eliminates duplicate helper rules (e.g. in jp example)