code: @Override
      public int parity(long[] current) {
  
          int count = 0;
  
          for (int i = 0, n = indices.length; i < n; i++) {
              for (int j = i + 1; j < n; j++) {
                  int cmp = compare(current[indices[i]], current[indices[j]]);
                  if (cmp == 0)
                      return 0;
                  else if (cmp > 0) count++;
              }
          }
  
          // value is odd, -1 or value is even +1
          return Integer.lowestOneBit(count) == 1 ? -1 : +1;
      }
docs: The number values to check is typically small ({@literal < 5}) and thus
  we use brute-force to count the number of inversions.
  
  {@inheritDoc}