code: private static boolean arraysEqual(int[] array1, int count1, int[] array2, int count2) {
          if (count1 != count2) {
              return false;
          }
  
          for (int i = 0; i < count1; i++) {
              if (array1[i] != array2[i])
                  return false;
          }
  
          return true;
      }
docs: Determines whether two integer arrays contain identical elements.
  <p/>
  The native implementation over-allocated the arrays (and may have stuff left over from
  a previous run), so we can't just check the arrays -- the separately-maintained count
  field also matters.  We assume that a null array will have a count of zero, and that the
  array can hold as many elements as the associated count indicates.
  <p/>
  TODO: replace this with Arrays.equals() when the old parser goes away.