code: int getSecondaryBefore(long p, int s) {
          int index;
          int previousSec, sec;
          if(p == 0) {
              index = (int)elements[IX_FIRST_SECONDARY_INDEX];
              // Gap at the beginning of the secondary CE range.
              previousSec = 0;
              sec = (int)(elements[index] >> 16);
          } else {
              index = findPrimary(p) + 1;
              previousSec = Collation.BEFORE_WEIGHT16;
              sec = (int)getFirstSecTerForPrimary(index) >>> 16;
          }
          assert(s >= sec);
          while(s > sec) {
              previousSec = sec;
              assert((elements[index] & SEC_TER_DELTA_FLAG) != 0);
              sec = (int)(elements[index++] >> 16);
          }
          assert(sec == s);
          return previousSec;
      }
docs: Returns the secondary weight before [p, s].