code: private int getWeight16Before(int index, long node, int level) {
          assert(strengthFromNode(node) < level || !isTailoredNode(node));
          // Collect the root CE weights if this node is for a root CE.
          // If it is not, then return the low non-primary boundary for a tailored CE.
          int t;
          if(strengthFromNode(node) == Collator.TERTIARY) {
              t = weight16FromNode(node);
          } else {
              t = Collation.COMMON_WEIGHT16;  // Stronger node with implied common weight.
          }
          while(strengthFromNode(node) > Collator.SECONDARY) {
              index = previousIndexFromNode(node);
              node = nodes.elementAti(index);
          }
          if(isTailoredNode(node)) {
              return Collation.BEFORE_WEIGHT16;
          }
          int s;
          if(strengthFromNode(node) == Collator.SECONDARY) {
              s = weight16FromNode(node);
          } else {
              s = Collation.COMMON_WEIGHT16;  // Stronger node with implied common weight.
          }
          while(strengthFromNode(node) > Collator.PRIMARY) {
              index = previousIndexFromNode(node);
              node = nodes.elementAti(index);
          }
          if(isTailoredNode(node)) {
              return Collation.BEFORE_WEIGHT16;
          }
          // [p, s, t] is a root CE. Return the preceding weight for the requested level.
          long p = weight32FromNode(node);
          int weight16;
          if(level == Collator.SECONDARY) {
              weight16 = rootElements.getSecondaryBefore(p, s);
          } else {
              weight16 = rootElements.getTertiaryBefore(p, s, t);
              assert((weight16 & ~Collation.ONLY_TERTIARY_MASK) == 0);
          }
          return weight16;
      }
docs: Returns the secondary or tertiary weight preceding the current node's weight.
  node=nodes[index].