code: long getPrimaryBefore(long p, boolean isCompressible) {
          int index = findPrimary(p);
          int step;
          long q = elements[index];
          if(p == (q & 0xffffff00L)) {
              // Found p itself. Return the previous primary.
              // See if p is at the end of a previous range.
              step = (int)q & PRIMARY_STEP_MASK;
              if(step == 0) {
                  // p is not at the end of a range. Look for the previous primary.
                  do {
                      p = elements[--index];
                  } while((p & SEC_TER_DELTA_FLAG) != 0);
                  return p & 0xffffff00L;
              }
          } else {
              // p is in a range, and not at the start.
              long nextElement = elements[index + 1];
              assert(isEndOfPrimaryRange(nextElement));
              step = (int)nextElement & PRIMARY_STEP_MASK;
          }
          // Return the previous range primary.
          if((p & 0xffff) == 0) {
              return Collation.decTwoBytePrimaryByOneStep(p, isCompressible, step);
          } else {
              return Collation.decThreeBytePrimaryByOneStep(p, isCompressible, step);
          }
      }
docs: Returns the primary weight before p.
  p must be greater than the first root primary.